Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

build(viewer): refresh affected examples gallery and canonical package

HengYang1f01a95905a0
diff --git a/archify.zip b/archify.zip
index 59b52548..30e56032 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/examples/class-payment-processors-rendered.html b/archify/examples/class-payment-processors-rendered.html
index 488cec31..33d64cbd 100644
--- a/archify/examples/class-payment-processors-rendered.html
+++ b/archify/examples/class-payment-processors-rendered.html
@@ -5553,6 +5553,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9154,31 +9186,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13108,26 +13124,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13779,26 +13780,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/class-payments-rendered.html b/archify/examples/class-payments-rendered.html
index 7802891e..68614276 100644
--- a/archify/examples/class-payments-rendered.html
+++ b/archify/examples/class-payments-rendered.html
@@ -5359,6 +5359,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8960,31 +8992,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12914,26 +12930,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13585,26 +13586,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index 437e87a7..0f4eaf9c 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -5473,6 +5473,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9074,31 +9106,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13028,26 +13044,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13699,26 +13700,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/erd-orders-rendered.html b/archify/examples/erd-orders-rendered.html
index 78c7990f..be5be0bb 100644
--- a/archify/examples/erd-orders-rendered.html
+++ b/archify/examples/erd-orders-rendered.html
@@ -5641,6 +5641,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9242,31 +9274,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13196,26 +13212,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13867,26 +13868,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index 56abd288..c39dddf2 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -5485,6 +5485,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9086,31 +9118,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13040,26 +13056,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13711,26 +13712,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index 348b8c50..20e4da72 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -5488,6 +5488,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9089,31 +9121,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13043,26 +13059,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13714,26 +13715,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/subscription-billing-rendered.html b/archify/examples/subscription-billing-rendered.html
index cff69324..29333335 100644
--- a/archify/examples/subscription-billing-rendered.html
+++ b/archify/examples/subscription-billing-rendered.html
@@ -5865,6 +5865,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9466,31 +9498,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13420,26 +13436,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -14091,26 +14092,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/timeline-archify-dev-activity-rendered.html b/archify/examples/timeline-archify-dev-activity-rendered.html
index c666106b..ee04e51e 100644
--- a/archify/examples/timeline-archify-dev-activity-rendered.html
+++ b/archify/examples/timeline-archify-dev-activity-rendered.html
@@ -5565,6 +5565,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9166,31 +9198,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13120,26 +13136,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13791,26 +13792,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/timeline-payment-incident-rendered.html b/archify/examples/timeline-payment-incident-rendered.html
index 3ff01ea0..8d457c47 100644
--- a/archify/examples/timeline-payment-incident-rendered.html
+++ b/archify/examples/timeline-payment-incident-rendered.html
@@ -5350,6 +5350,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8951,31 +8983,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12905,26 +12921,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13576,26 +13577,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/tree-archify-repository-rendered.html b/archify/examples/tree-archify-repository-rendered.html
index 62ffcda4..8991261c 100644
--- a/archify/examples/tree-archify-repository-rendered.html
+++ b/archify/examples/tree-archify-repository-rendered.html
@@ -5584,6 +5584,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9185,31 +9217,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13139,26 +13155,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13810,26 +13811,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/tree-payment-platform-rendered.html b/archify/examples/tree-payment-platform-rendered.html
index 44f06a4c..7c0a69cc 100644
--- a/archify/examples/tree-payment-platform-rendered.html
+++ b/archify/examples/tree-payment-platform-rendered.html
@@ -5365,6 +5365,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8966,31 +8998,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12920,26 +12936,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13591,26 +13592,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/waterfall-checkout-request-rendered.html b/archify/examples/waterfall-checkout-request-rendered.html
index 6993c2c2..e0a810c9 100644
--- a/archify/examples/waterfall-checkout-request-rendered.html
+++ b/archify/examples/waterfall-checkout-request-rendered.html
@@ -5347,6 +5347,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8948,31 +8980,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12902,26 +12918,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13573,26 +13574,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/waterfall-example-rebuild-rendered.html b/archify/examples/waterfall-example-rebuild-rendered.html
index 95fd0e39..09086516 100644
--- a/archify/examples/waterfall-example-rebuild-rendered.html
+++ b/archify/examples/waterfall-example-rebuild-rendered.html
@@ -5533,6 +5533,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9134,31 +9166,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13088,26 +13104,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13759,26 +13760,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index 36109bfb..13ddf22f 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -5461,6 +5461,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9062,31 +9094,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13016,26 +13032,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13687,26 +13688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index 0726793e..b7b405ae 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -5479,6 +5479,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9080,31 +9112,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13034,26 +13050,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13705,26 +13706,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery.html b/docs/gallery.html
index ca7feb10..8cd9c547 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -302,7 +302,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6190fddb3c799c96a9a6d0d23313856cc7158f477cd505aa36f96e9359c204dc">6190fddb3c79</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7b88bb8da234c44bfc62dc62974d9d3495e123be03d9040bea2558311ece52e7">7b88bb8da234</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html#focus=planner" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -332,7 +332,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="f9b6df7f1da6f71a292ab88a7579fd7522fda80bce1bb0f756efe54e9b4acb52">f9b6df7f1da6</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e7e6bd4d054e902ca7ec7dca336903f53cbb7d534008d79e1baf508ff248b08b">e7e6bd4d054e</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html#focus=gateway" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -361,7 +361,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="80e93b231b50398c4c34b77fe7ad6494c6e9c46bb031b43ac1b4b40f21f98a1c">80e93b231b50</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="36be71bb554706d0d4577453cb6c5a67cf9b1760291acab4b74ac86b87a47ac4">36be71bb5547</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html#focus=redis" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -390,7 +390,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="1a384f3fdfdc1110ab49ef64ec5a5f5c5e9d2cff046b0259e083d8f8b292f1e7">1a384f3fdfdc</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6d770600ff5d367a305cdceca1f5a6a2d36f9c02c93b51178fd0672047ca5495">6d770600ff5d</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -419,7 +419,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3b48c070771a1f3a11df5cb44fe8a90c71b49ec85a1f324a4223c83395725d83">3b48c070771a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="50ad085a9468df23ff45fe78519be9b4b8305a9944400a92857d085e0c833601">50ad085a9468</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html#focus=triage" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -448,7 +448,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="b34eb24c6efb95d30c553de3408d67bdaf701b5e29c8460d1743e65a524101c3">b34eb24c6efb</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="8c7eafe5dc05e676ea16ab7822e6bb96dbf891c1a55ad2777e8a2782c8d790a6">8c7eafe5dc05</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html#focus=consent" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -477,7 +477,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="39a09a8bcc82a5481efce3bd8e7fc50b402f5094ae93fb98ea3e38c6bfb16c81">39a09a8bcc82</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="069eb87739aeda01826507840022afe3848dd5149f22b8a04dfde801bf9d1f64">069eb87739ae</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html#focus=queue" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -506,7 +506,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="75938cbb2e17c3cde8ed2e63b2e9ad8793dc8094420076a5bc927d6b37fc0332">75938cbb2e17</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="f25556cdb5a7dbe394228c486274eff489704877ba66b5c995868a4f397b48f9">f25556cdb5a7</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html#focus=orders" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -535,7 +535,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e363fdb54f2a6cb3ef3262b081515212524f4b24a0cb5103f3dd301fe8764c5d">e363fdb54f2a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="bb2b287317189593905b7d36d694852b3994189483ca0b1ff2e86ea96a0b50e6">bb2b28731718</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html#focus=approval" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -564,7 +564,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 15E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c3f8c43cf89164778bcb43412d9b8a6652248f6c7e76ddfe4691e429fea2d607">c3f8c43cf891</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5b52cbe1f6b8c76b03e922b1a4f78bb6c6ad1c06f815369b556503a01b385e3e">5b52cbe1f6b8</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html#focus=live" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -593,7 +593,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e81cb13231b857b941f439068ca0ca200e83d068135b2c6fd4bcbcf128ec4253">e81cb13231b8</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c05cda729b676ee205884a8f3bf99b012925b3bd4a2733c75b544bf7f1d5f0a0">c05cda729b67</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html#focus=api" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -622,7 +622,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">6N · 5E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="32fb3559c4457f19f6b36cdac4c835d96e7aaa5f457d2783c62b9c7013013585">32fb3559c445</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d0cfd4b6f177a4ad08998fd15290d8a24f0bb6c201c46975984467e21ad6d0ed">d0cfd4b6f177</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/orders.erd.html#focus=order" target="_blank" rel="noopener" data-en="Explore focus ↗" data-zh="探索聚焦路径 ↗">Explore focus ↗</a>
@@ -701,8 +701,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 784769,
- "artifactSha256": "6190fddb3c799c96a9a6d0d23313856cc7158f477cd505aa36f96e9359c204dc",
+ "artifactBytes": 784227,
+ "artifactSha256": "7b88bb8da234c44bfc62dc62974d9d3495e123be03d9040bea2558311ece52e7",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -836,8 +836,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 787487,
- "artifactSha256": "f9b6df7f1da6f71a292ab88a7579fd7522fda80bce1bb0f756efe54e9b4acb52",
+ "artifactBytes": 786945,
+ "artifactSha256": "e7e6bd4d054e902ca7ec7dca336903f53cbb7d534008d79e1baf508ff248b08b",
"sourceBytes": 4734,
"sourceSha256": "610a5614667e8f108bdcf1769c9d7af5c3ce0fb62be3ea50550b10eb752e4bda",
"checks": [
@@ -969,8 +969,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 779300,
- "artifactSha256": "80e93b231b50398c4c34b77fe7ad6494c6e9c46bb031b43ac1b4b40f21f98a1c",
+ "artifactBytes": 778758,
+ "artifactSha256": "36be71bb554706d0d4577453cb6c5a67cf9b1760291acab4b74ac86b87a47ac4",
"sourceBytes": 3805,
"sourceSha256": "f8486daa803fff6c295cecca4604c561fbbf9acb2e83326022b5a87639e8afe6",
"checks": [
@@ -1103,8 +1103,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 780273,
- "artifactSha256": "1a384f3fdfdc1110ab49ef64ec5a5f5c5e9d2cff046b0259e083d8f8b292f1e7",
+ "artifactBytes": 779731,
+ "artifactSha256": "6d770600ff5d367a305cdceca1f5a6a2d36f9c02c93b51178fd0672047ca5495",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -1243,8 +1243,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 777593,
- "artifactSha256": "3b48c070771a1f3a11df5cb44fe8a90c71b49ec85a1f324a4223c83395725d83",
+ "artifactBytes": 777051,
+ "artifactSha256": "50ad085a9468df23ff45fe78519be9b4b8305a9944400a92857d085e0c833601",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -1429,8 +1429,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 781595,
- "artifactSha256": "b34eb24c6efb95d30c553de3408d67bdaf701b5e29c8460d1743e65a524101c3",
+ "artifactBytes": 781053,
+ "artifactSha256": "8c7eafe5dc05e676ea16ab7822e6bb96dbf891c1a55ad2777e8a2782c8d790a6",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -1564,8 +1564,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 779646,
- "artifactSha256": "39a09a8bcc82a5481efce3bd8e7fc50b402f5094ae93fb98ea3e38c6bfb16c81",
+ "artifactBytes": 779104,
+ "artifactSha256": "069eb87739aeda01826507840022afe3848dd5149f22b8a04dfde801bf9d1f64",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1716,8 +1716,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 785515,
- "artifactSha256": "75938cbb2e17c3cde8ed2e63b2e9ad8793dc8094420076a5bc927d6b37fc0332",
+ "artifactBytes": 784973,
+ "artifactSha256": "f25556cdb5a7dbe394228c486274eff489704877ba66b5c995868a4f397b48f9",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1868,8 +1868,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 12,
- "artifactBytes": 785682,
- "artifactSha256": "e363fdb54f2a6cb3ef3262b081515212524f4b24a0cb5103f3dd301fe8764c5d",
+ "artifactBytes": 785140,
+ "artifactSha256": "bb2b287317189593905b7d36d694852b3994189483ca0b1ff2e86ea96a0b50e6",
"sourceBytes": 3260,
"sourceSha256": "5ba36f5ce91ed428cb48b599e275424916d82b619b9a3231cbd1bbc3966fc54b",
"checks": [
@@ -1990,8 +1990,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 15,
- "artifactBytes": 792458,
- "artifactSha256": "c3f8c43cf89164778bcb43412d9b8a6652248f6c7e76ddfe4691e429fea2d607",
+ "artifactBytes": 791916,
+ "artifactSha256": "5b52cbe1f6b8c76b03e922b1a4f78bb6c6ad1c06f815369b556503a01b385e3e",
"sourceBytes": 4155,
"sourceSha256": "e3dc105d03c1c9881160006cdace23cb5d8533803e337caf0ec287c64e775275",
"checks": [
@@ -2112,8 +2112,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 780026,
- "artifactSha256": "e81cb13231b857b941f439068ca0ca200e83d068135b2c6fd4bcbcf128ec4253",
+ "artifactBytes": 779484,
+ "artifactSha256": "c05cda729b676ee205884a8f3bf99b012925b3bd4a2733c75b544bf7f1d5f0a0",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
@@ -2258,8 +2258,8 @@ receipt 108 checks / 12 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 6,
"edgeCount": 5,
- "artifactBytes": 794243,
- "artifactSha256": "32fb3559c4457f19f6b36cdac4c835d96e7aaa5f457d2783c62b9c7013013585",
+ "artifactBytes": 793701,
+ "artifactSha256": "d0cfd4b6f177a4ad08998fd15290d8a24f0bb6c201c46975984467e21ad6d0ed",
"sourceBytes": 7321,
"sourceSha256": "1777a374647084466f4d7ce3a968004be6ab70ac9cf82459b96bed7c556cdfdd",
"checks": [
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index 56abd288..c39dddf2 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -5485,6 +5485,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9086,31 +9118,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13040,26 +13056,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13711,26 +13712,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index 0726793e..b7b405ae 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -5479,6 +5479,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9080,31 +9112,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13034,26 +13050,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13705,26 +13706,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index 21194391..bb3a9bb4 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -5500,6 +5500,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9101,31 +9133,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13055,26 +13071,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13726,26 +13727,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index 348b8c50..20e4da72 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -5488,6 +5488,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9089,31 +9121,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13043,26 +13059,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13714,26 +13715,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index e742095a..b6d56ce2 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -5549,6 +5549,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9150,31 +9182,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13104,26 +13120,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13775,26 +13776,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index 6cf2c2a2..9eea5a55 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -5512,6 +5512,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9113,31 +9145,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13067,26 +13083,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13738,26 +13739,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index aaace856..8f8b4a2c 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -5439,6 +5439,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9040,31 +9072,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12994,26 +13010,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13665,26 +13666,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/orders.erd.html b/docs/gallery/artifacts/orders.erd.html
index 78c7990f..be5be0bb 100644
--- a/docs/gallery/artifacts/orders.erd.html
+++ b/docs/gallery/artifacts/orders.erd.html
@@ -5641,6 +5641,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9242,31 +9274,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13196,26 +13212,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13867,26 +13868,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index 437e87a7..0f4eaf9c 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -5473,6 +5473,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9074,31 +9106,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13028,26 +13044,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13699,26 +13700,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index aee0fdf7..9f1a9ce6 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -5516,6 +5516,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9117,31 +9149,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13071,26 +13087,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13742,26 +13743,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index d894a680..36a94283 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -5465,6 +5465,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9066,31 +9098,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13020,26 +13036,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13691,26 +13692,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index 36109bfb..13ddf22f 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -5461,6 +5461,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9062,31 +9094,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13016,26 +13032,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13687,26 +13688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index 1379eb8e..93711002 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -19,8 +19,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 784769,
- "artifactSha256": "6190fddb3c799c96a9a6d0d23313856cc7158f477cd505aa36f96e9359c204dc",
+ "artifactBytes": 784227,
+ "artifactSha256": "7b88bb8da234c44bfc62dc62974d9d3495e123be03d9040bea2558311ece52e7",
"sourceBytes": 4939,
"sourceSha256": "d67965d50872c97e4ff3476271e645bf19fab6b3ab44e111bdb44b063e3aa36f",
"checks": [
@@ -154,8 +154,8 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 787487,
- "artifactSha256": "f9b6df7f1da6f71a292ab88a7579fd7522fda80bce1bb0f756efe54e9b4acb52",
+ "artifactBytes": 786945,
+ "artifactSha256": "e7e6bd4d054e902ca7ec7dca336903f53cbb7d534008d79e1baf508ff248b08b",
"sourceBytes": 4734,
"sourceSha256": "610a5614667e8f108bdcf1769c9d7af5c3ce0fb62be3ea50550b10eb752e4bda",
"checks": [
@@ -287,8 +287,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 779300,
- "artifactSha256": "80e93b231b50398c4c34b77fe7ad6494c6e9c46bb031b43ac1b4b40f21f98a1c",
+ "artifactBytes": 778758,
+ "artifactSha256": "36be71bb554706d0d4577453cb6c5a67cf9b1760291acab4b74ac86b87a47ac4",
"sourceBytes": 3805,
"sourceSha256": "f8486daa803fff6c295cecca4604c561fbbf9acb2e83326022b5a87639e8afe6",
"checks": [
@@ -421,8 +421,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 780273,
- "artifactSha256": "1a384f3fdfdc1110ab49ef64ec5a5f5c5e9d2cff046b0259e083d8f8b292f1e7",
+ "artifactBytes": 779731,
+ "artifactSha256": "6d770600ff5d367a305cdceca1f5a6a2d36f9c02c93b51178fd0672047ca5495",
"sourceBytes": 4510,
"sourceSha256": "dbd5c174af66296caec372e7214cf4df7158b50a563508e16826b95ab8d1cd6c",
"checks": [
@@ -561,8 +561,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 777593,
- "artifactSha256": "3b48c070771a1f3a11df5cb44fe8a90c71b49ec85a1f324a4223c83395725d83",
+ "artifactBytes": 777051,
+ "artifactSha256": "50ad085a9468df23ff45fe78519be9b4b8305a9944400a92857d085e0c833601",
"sourceBytes": 4723,
"sourceSha256": "630be98449925d2716ecb8439f404b2bff5fe65ba905b0ad0baea6d96890c526",
"checks": [
@@ -747,8 +747,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 781595,
- "artifactSha256": "b34eb24c6efb95d30c553de3408d67bdaf701b5e29c8460d1743e65a524101c3",
+ "artifactBytes": 781053,
+ "artifactSha256": "8c7eafe5dc05e676ea16ab7822e6bb96dbf891c1a55ad2777e8a2782c8d790a6",
"sourceBytes": 5035,
"sourceSha256": "8a635db9e51a5b1a8d2955b9d66f5b9a450e0a298432ce8f2e2f0be11f372e05",
"checks": [
@@ -882,8 +882,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 779646,
- "artifactSha256": "39a09a8bcc82a5481efce3bd8e7fc50b402f5094ae93fb98ea3e38c6bfb16c81",
+ "artifactBytes": 779104,
+ "artifactSha256": "069eb87739aeda01826507840022afe3848dd5149f22b8a04dfde801bf9d1f64",
"sourceBytes": 3766,
"sourceSha256": "b8c6c52f1763ede2933c77deb8da59b3e06917bc41d27e66df896136456b859a",
"checks": [
@@ -1034,8 +1034,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 785515,
- "artifactSha256": "75938cbb2e17c3cde8ed2e63b2e9ad8793dc8094420076a5bc927d6b37fc0332",
+ "artifactBytes": 784973,
+ "artifactSha256": "f25556cdb5a7dbe394228c486274eff489704877ba66b5c995868a4f397b48f9",
"sourceBytes": 4769,
"sourceSha256": "3bdd77674282009c7c68d588cf8a3c495bc98a3be1b9c45327fd1801a6f83a23",
"checks": [
@@ -1186,8 +1186,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 12,
- "artifactBytes": 785682,
- "artifactSha256": "e363fdb54f2a6cb3ef3262b081515212524f4b24a0cb5103f3dd301fe8764c5d",
+ "artifactBytes": 785140,
+ "artifactSha256": "bb2b287317189593905b7d36d694852b3994189483ca0b1ff2e86ea96a0b50e6",
"sourceBytes": 3260,
"sourceSha256": "5ba36f5ce91ed428cb48b599e275424916d82b619b9a3231cbd1bbc3966fc54b",
"checks": [
@@ -1308,8 +1308,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 15,
- "artifactBytes": 792458,
- "artifactSha256": "c3f8c43cf89164778bcb43412d9b8a6652248f6c7e76ddfe4691e429fea2d607",
+ "artifactBytes": 791916,
+ "artifactSha256": "5b52cbe1f6b8c76b03e922b1a4f78bb6c6ad1c06f815369b556503a01b385e3e",
"sourceBytes": 4155,
"sourceSha256": "e3dc105d03c1c9881160006cdace23cb5d8533803e337caf0ec287c64e775275",
"checks": [
@@ -1430,8 +1430,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 780026,
- "artifactSha256": "e81cb13231b857b941f439068ca0ca200e83d068135b2c6fd4bcbcf128ec4253",
+ "artifactBytes": 779484,
+ "artifactSha256": "c05cda729b676ee205884a8f3bf99b012925b3bd4a2733c75b544bf7f1d5f0a0",
"sourceBytes": 3197,
"sourceSha256": "95e051b27a9e4a3307e194c0f666fca4af51470be7e2228d400ff48aea5b353b",
"checks": [
@@ -1576,8 +1576,8 @@
"engineeringProfile": null,
"nodeCount": 6,
"edgeCount": 5,
- "artifactBytes": 794243,
- "artifactSha256": "32fb3559c4457f19f6b36cdac4c835d96e7aaa5f457d2783c62b9c7013013585",
+ "artifactBytes": 793701,
+ "artifactSha256": "d0cfd4b6f177a4ad08998fd15290d8a24f0bb6c201c46975984467e21ad6d0ed",
"sourceBytes": 7321,
"sourceSha256": "1777a374647084466f4d7ce3a968004be6ab70ac9cf82459b96bed7c556cdfdd",
"checks": [
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index e5ea3719..a35e7545 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -10078,6 +10078,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute(&#39;data-reading-link-template&#39;);
+ if (template === null) return location.href.replace(/#.*$/, &#39;&#39;) + &#39;#&#39; + state;
+ if (!template || template.length &gt; 4096 || template.split(&#39;{state}&#39;).length !== 2) return null;
+ try {
+ var url = new URL(template.replace(&#39;{state}&#39;, encodeURIComponent(state)));
+ if ([&#39;http:&#39;, &#39;https:&#39;, &#39;file:&#39;].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement(&#39;textarea&#39;);
+ field.value = value;
+ field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
+ field.style.position = &#39;fixed&#39;;
+ field.style.opacity = &#39;0&#39;;
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== &#39;function&#39; || policy.allowsFeature(&#39;clipboard-write&#39;);
+ return allowed &amp;&amp; navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute(&#39;data-ambient-flow-overlay&#39;)) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -13679,31 +13711,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record &amp;&amp; record.id;
- var value = location.href.replace(/#.*$/, &#39;&#39;) + (relationId
- ? &#39;#relation=&#39; + encodeURIComponent(relationId)
- : &#39;#focus=&#39; + encodeURIComponent(activeIds[0]) + (reachabilityMode ? &#39;&amp;reach=&#39; + reachabilityMode : &#39;&#39;));
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? &#39;relation=&#39; + encodeURIComponent(relationId)
+ : &#39;focus=&#39; + encodeURIComponent(activeIds[0]) + (reachabilityMode ? &#39;&amp;reach=&#39; + reachabilityMode : &#39;&#39;));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
copyBtn.setAttribute(&#39;aria-label&#39;, copied
? viewerText(relationId ? &#39;viewer.passport.copy.pinned.success&#39; : &#39;viewer.passport.copy.focused.success&#39;)
@@ -17633,26 +17649,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== &#39;result&#39;) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, &#39;&#39;) + &#39;#route=&#39; + encodeURIComponent(startId) + &#39;~&#39; + encodeURIComponent(endId);
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(&#39;route=&#39; + encodeURIComponent(startId) + &#39;~&#39; + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
copyBtn.setAttribute(&#39;aria-label&#39;, viewerText(copied ? &#39;viewer.route.copy.success&#39; : &#39;viewer.route.copy.failed&#39;));
window.setTimeout(function () {
@@ -18304,26 +18305,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, &#39;&#39;) + &#39;#lens=&#39; + selectedKinds.map(encodeURIComponent).join(&#39;~&#39;);
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(&#39;lens=&#39; + selectedKinds.map(encodeURIComponent).join(&#39;~&#39;));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
window.setTimeout(function () { copyBtn.textContent = viewerText(&#39;viewer.common.copyLink&#39;); }, 1600);
return copied;
@@ -24429,6 +24415,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute(&#39;data-reading-link-template&#39;);
+ if (template === null) return location.href.replace(/#.*$/, &#39;&#39;) + &#39;#&#39; + state;
+ if (!template || template.length &gt; 4096 || template.split(&#39;{state}&#39;).length !== 2) return null;
+ try {
+ var url = new URL(template.replace(&#39;{state}&#39;, encodeURIComponent(state)));
+ if ([&#39;http:&#39;, &#39;https:&#39;, &#39;file:&#39;].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement(&#39;textarea&#39;);
+ field.value = value;
+ field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
+ field.style.position = &#39;fixed&#39;;
+ field.style.opacity = &#39;0&#39;;
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== &#39;function&#39; || policy.allowsFeature(&#39;clipboard-write&#39;);
+ return allowed &amp;&amp; navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute(&#39;data-ambient-flow-overlay&#39;)) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -28030,31 +28048,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record &amp;&amp; record.id;
- var value = location.href.replace(/#.*$/, &#39;&#39;) + (relationId
- ? &#39;#relation=&#39; + encodeURIComponent(relationId)
- : &#39;#focus=&#39; + encodeURIComponent(activeIds[0]) + (reachabilityMode ? &#39;&amp;reach=&#39; + reachabilityMode : &#39;&#39;));
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? &#39;relation=&#39; + encodeURIComponent(relationId)
+ : &#39;focus=&#39; + encodeURIComponent(activeIds[0]) + (reachabilityMode ? &#39;&amp;reach=&#39; + reachabilityMode : &#39;&#39;));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
copyBtn.setAttribute(&#39;aria-label&#39;, copied
? viewerText(relationId ? &#39;viewer.passport.copy.pinned.success&#39; : &#39;viewer.passport.copy.focused.success&#39;)
@@ -31984,26 +31986,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== &#39;result&#39;) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, &#39;&#39;) + &#39;#route=&#39; + encodeURIComponent(startId) + &#39;~&#39; + encodeURIComponent(endId);
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(&#39;route=&#39; + encodeURIComponent(startId) + &#39;~&#39; + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
copyBtn.setAttribute(&#39;aria-label&#39;, viewerText(copied ? &#39;viewer.route.copy.success&#39; : &#39;viewer.route.copy.failed&#39;));
window.setTimeout(function () {
@@ -32655,26 +32642,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement(&#39;textarea&#39;);
- field.value = value;
- field.setAttribute(&#39;readonly&#39;, &#39;&#39;);
- field.style.position = &#39;fixed&#39;;
- field.style.opacity = &#39;0&#39;;
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand(&#39;copy&#39;); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, &#39;&#39;) + &#39;#lens=&#39; + selectedKinds.map(encodeURIComponent).join(&#39;~&#39;);
- var copy = navigator.clipboard &amp;&amp; typeof navigator.clipboard.writeText === &#39;function&#39;
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(&#39;lens=&#39; + selectedKinds.map(encodeURIComponent).join(&#39;~&#39;));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? &#39;viewer.common.copied&#39; : &#39;viewer.common.copyFailed&#39;);
window.setTimeout(function () { copyBtn.textContent = viewerText(&#39;viewer.common.copyLink&#39;); }, 1600);
return copied;
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index eef1aa23..cd25e024 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,8 +219,8 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "ffe6ee291b392151959e253bdf1aca35d4cc71e7794cb93627742bc9e77982af",
- "bytes": 2158061
+ "sha256": "9b1d15fbe836764187d8056cd9e5bd7196d51c3aee2c9365f6082264254ba74a",
+ "bytes": 2156855
},
"validation": {
"checksPassed": 28,
diff --git a/examples/class-payment-processors-rendered.html b/examples/class-payment-processors-rendered.html
index 488cec31..33d64cbd 100644
--- a/examples/class-payment-processors-rendered.html
+++ b/examples/class-payment-processors-rendered.html
@@ -5553,6 +5553,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9154,31 +9186,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13108,26 +13124,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13779,26 +13780,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/class-payments-rendered.html b/examples/class-payments-rendered.html
index 7802891e..68614276 100644
--- a/examples/class-payments-rendered.html
+++ b/examples/class-payments-rendered.html
@@ -5359,6 +5359,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8960,31 +8992,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12914,26 +12930,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13585,26 +13586,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index 437e87a7..0f4eaf9c 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -5473,6 +5473,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9074,31 +9106,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13028,26 +13044,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13699,26 +13700,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/erd-orders-rendered.html b/examples/erd-orders-rendered.html
index 78c7990f..be5be0bb 100644
--- a/examples/erd-orders-rendered.html
+++ b/examples/erd-orders-rendered.html
@@ -5641,6 +5641,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9242,31 +9274,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13196,26 +13212,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13867,26 +13868,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index 56abd288..c39dddf2 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -5485,6 +5485,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9086,31 +9118,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13040,26 +13056,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13711,26 +13712,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index 348b8c50..20e4da72 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -5488,6 +5488,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9089,31 +9121,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13043,26 +13059,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13714,26 +13715,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/subscription-billing-rendered.html b/examples/subscription-billing-rendered.html
index cff69324..29333335 100644
--- a/examples/subscription-billing-rendered.html
+++ b/examples/subscription-billing-rendered.html
@@ -5865,6 +5865,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9466,31 +9498,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13420,26 +13436,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -14091,26 +14092,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/timeline-archify-dev-activity-rendered.html b/examples/timeline-archify-dev-activity-rendered.html
index c666106b..ee04e51e 100644
--- a/examples/timeline-archify-dev-activity-rendered.html
+++ b/examples/timeline-archify-dev-activity-rendered.html
@@ -5565,6 +5565,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9166,31 +9198,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13120,26 +13136,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13791,26 +13792,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/timeline-payment-incident-rendered.html b/examples/timeline-payment-incident-rendered.html
index 3ff01ea0..8d457c47 100644
--- a/examples/timeline-payment-incident-rendered.html
+++ b/examples/timeline-payment-incident-rendered.html
@@ -5350,6 +5350,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8951,31 +8983,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12905,26 +12921,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13576,26 +13577,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/tree-archify-repository-rendered.html b/examples/tree-archify-repository-rendered.html
index 62ffcda4..8991261c 100644
--- a/examples/tree-archify-repository-rendered.html
+++ b/examples/tree-archify-repository-rendered.html
@@ -5584,6 +5584,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9185,31 +9217,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13139,26 +13155,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13810,26 +13811,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/tree-payment-platform-rendered.html b/examples/tree-payment-platform-rendered.html
index 44f06a4c..7c0a69cc 100644
--- a/examples/tree-payment-platform-rendered.html
+++ b/examples/tree-payment-platform-rendered.html
@@ -5365,6 +5365,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8966,31 +8998,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12920,26 +12936,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13591,26 +13592,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/waterfall-checkout-request-rendered.html b/examples/waterfall-checkout-request-rendered.html
index 6993c2c2..e0a810c9 100644
--- a/examples/waterfall-checkout-request-rendered.html
+++ b/examples/waterfall-checkout-request-rendered.html
@@ -5347,6 +5347,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -8948,31 +8980,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -12902,26 +12918,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13573,26 +13574,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/waterfall-example-rebuild-rendered.html b/examples/waterfall-example-rebuild-rendered.html
index 95fd0e39..09086516 100644
--- a/examples/waterfall-example-rebuild-rendered.html
+++ b/examples/waterfall-example-rebuild-rendered.html
@@ -5533,6 +5533,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9134,31 +9166,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13088,26 +13104,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13759,26 +13760,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index 36109bfb..13ddf22f 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -5461,6 +5461,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9062,31 +9094,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13016,26 +13032,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13687,26 +13688,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/web-app.html b/examples/web-app.html
index 336c63af..71a21ba0 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -5460,6 +5460,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9061,31 +9093,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13015,26 +13031,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13686,26 +13687,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index 0726793e..b7b405ae 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -5479,6 +5479,38 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); });
}
+ function readerLink(state) {
+ var template = document.documentElement.getAttribute('data-reading-link-template');
+ if (template === null) return location.href.replace(/#.*$/, '') + '#' + state;
+ if (!template || template.length > 4096 || template.split('{state}').length !== 2) return null;
+ try {
+ var url = new URL(template.replace('{state}', encodeURIComponent(state)));
+ if (['http:', 'https:', 'file:'].indexOf(url.protocol) === -1 || url.username || url.password) return null;
+ return url.href;
+ } catch (_) { return null; }
+ }
+
+ function copyReaderText(value) {
+ function fallbackCopy() {
+ var field = document.createElement('textarea');
+ field.value = value;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.appendChild(field);
+ field.select();
+ var copied = false;
+ try { copied = document.execCommand('copy'); } catch (_) {}
+ field.remove();
+ return copied;
+ }
+ var policy = document.permissionsPolicy || document.featurePolicy;
+ var allowed = !policy || typeof policy.allowsFeature !== 'function' || policy.allowsFeature('clipboard-write');
+ return allowed && navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
+ ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(fallbackCopy)
+ : Promise.resolve(fallbackCopy());
+ }
+
function hasDrawableGeometry(element) {
if (!element || element.hasAttribute('data-ambient-flow-overlay')) return false;
var geometries = /^(path|line|polyline)$/i.test(element.tagName)
@@ -9080,31 +9112,15 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
return setMany([id], options);
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
-
function copyFocusLink() {
if (activeIds.length !== 1) return Promise.resolve(false);
var record = pinnedRelationshipRecord();
var relationId = record && record.id;
- var value = location.href.replace(/#.*$/, '') + (relationId
- ? '#relation=' + encodeURIComponent(relationId)
- : '#focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink(relationId
+ ? 'relation=' + encodeURIComponent(relationId)
+ : 'focus=' + encodeURIComponent(activeIds[0]) + (reachabilityMode ? '&reach=' + reachabilityMode : ''));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', copied
? viewerText(relationId ? 'viewer.passport.copy.pinned.success' : 'viewer.passport.copy.focused.success')
@@ -13034,26 +13050,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (!context || !Archify.finder) return false;
return Archify.finder.open({ context: context });
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (mode !== 'result') return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId);
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('route=' + encodeURIComponent(startId) + '~' + encodeURIComponent(endId));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
copyBtn.setAttribute('aria-label', viewerText(copied ? 'viewer.route.copy.success' : 'viewer.route.copy.failed'));
window.setTimeout(function () {
@@ -13705,26 +13706,11 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
if (options.closePanel === true) close({ restoreFocus: false });
return false;
}
- function fallbackCopy(value) {
- var field = document.createElement('textarea');
- field.value = value;
- field.setAttribute('readonly', '');
- field.style.position = 'fixed';
- field.style.opacity = '0';
- document.body.appendChild(field);
- field.select();
- var copied = false;
- try { copied = document.execCommand('copy'); } catch (_) {}
- field.remove();
- return copied;
- }
function copyLink() {
if (!selectedKinds.length) return Promise.resolve(false);
- var value = location.href.replace(/#.*$/, '') + '#lens=' + selectedKinds.map(encodeURIComponent).join('~');
- var copy = navigator.clipboard && typeof navigator.clipboard.writeText === 'function'
- ? navigator.clipboard.writeText(value).then(function () { return true; }).catch(function () { return fallbackCopy(value); })
- : Promise.resolve(fallbackCopy(value));
- return copy.then(function (copied) {
+ var value = readerLink('lens=' + selectedKinds.map(encodeURIComponent).join('~'));
+ if (value === null) return Promise.resolve(false);
+ return copyReaderText(value).then(function (copied) {
copyBtn.textContent = viewerText(copied ? 'viewer.common.copied' : 'viewer.common.copyFailed');
window.setTimeout(function () { copyBtn.textContent = viewerText('viewer.common.copyLink'); }, 1600);
return copied;