dsh-claude-slides 2.12.0 → 2.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -1
- package/package.json +14 -14
- package/skills/claude-slides/scripts/artifact.mjs +9 -2
- package/skills/claude-slides/scripts/editor/assets/{index-D55QgVzE.js → index-BIvbGgb1.js} +142 -142
- package/skills/claude-slides/scripts/editor/assets/{woff2-decoder-CNWy3Xyb.js → woff2-decoder-ByxtpGxr.js} +1 -1
- package/skills/claude-slides/scripts/editor/index.html +1 -1
- package/skills/claude-slides/scripts/editor/node/compiler.cjs +77 -6
- package/skills/claude-slides/scripts/server.mjs +17 -4
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<script id="appifact-mode">(function(){var h=document.documentElement;function s(){var t=h.getAttribute('data-theme');if(t==='light'||t==='dark'){h.setAttribute('data-mode',t)}else{h.removeAttribute('data-mode')}}s();if(typeof MutationObserver==='function'){new MutationObserver(s).observe(h,{attributes:true,attributeFilter:['data-theme']})}})();</script>
|
|
9
9
|
<script id="appifact-flags">(function(){var values={slides_theme_tab:true,appifact_icon_set:true,appifact_bottom_toolbar:false,appifact_extra_export_formats:window.parent===window};function kind(v){return v===null?"null":Array.isArray(v)?"array":typeof v}function copy(v){return JSON.parse(JSON.stringify(v))}function get(key,fallback){if(!Object.prototype.hasOwnProperty.call(values,key)||kind(values[key])!==kind(fallback))return fallback;return copy(values[key])}globalThis.__appifact_flags={version:"appifact-flags:v2",ready:function(){return Promise.resolve(true)},get:get,all:function(){return copy(values)},latest:get,onLatest:function(){return function(){}},askAgain:function(){}};})();</script>
|
|
10
10
|
<title>Slides</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-BIvbGgb1.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./assets/index-BCy7EbiI.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -263816,6 +263816,9 @@ function installBridgePlaceLinks(runtime2) {
|
|
|
263816
263816
|
var COPY_PAGE_LINK_FAILURES;
|
|
263817
263817
|
var isCopySlideLinkShortcut;
|
|
263818
263818
|
var COPY_SLIDE_LINK_SHORTCUT;
|
|
263819
|
+
var LOCAL_ADDRESS_PUSH_LIMIT;
|
|
263820
|
+
var localAddressPushes;
|
|
263821
|
+
var localAddressPlace;
|
|
263819
263822
|
function readLastPlace(storage, memoryScope) {
|
|
263820
263823
|
try {
|
|
263821
263824
|
let value = storage?.getItem(
|
|
@@ -263831,7 +263834,9 @@ function installBridgePlaceLinks(runtime2) {
|
|
|
263831
263834
|
return Promise.resolve("invalid_fragment");
|
|
263832
263835
|
}
|
|
263833
263836
|
if (win.parent === win) {
|
|
263834
|
-
return
|
|
263837
|
+
return copyLocalPageLink(fragment, win).catch(
|
|
263838
|
+
() => "clipboard_denied"
|
|
263839
|
+
);
|
|
263835
263840
|
}
|
|
263836
263841
|
let id = "place-" + Math.random().toString(36).slice(2, 10);
|
|
263837
263842
|
return new Promise((resolve) => {
|
|
@@ -263973,8 +263978,59 @@ function installBridgePlaceLinks(runtime2) {
|
|
|
263973
263978
|
}
|
|
263974
263979
|
return fragment === null ? null : { place: fragment, why: "known" };
|
|
263975
263980
|
}
|
|
263981
|
+
function writeLocalAddressBar(fragment, tab, win = window) {
|
|
263982
|
+
localAddressPlace = fragment;
|
|
263983
|
+
let current = win.location.hash.slice(1);
|
|
263984
|
+
if (current === fragment || current.startsWith("comment-")) {
|
|
263985
|
+
return;
|
|
263986
|
+
}
|
|
263987
|
+
let activation = win.navigator.userActivation, push = tab && localAddressPushes < LOCAL_ADDRESS_PUSH_LIMIT && PLACE_LINK_FRAGMENT_PATTERN.test(current) && activation?.isActive !== false;
|
|
263988
|
+
try {
|
|
263989
|
+
let url = `${win.location.pathname}${win.location.search}#${fragment}`;
|
|
263990
|
+
if (push) {
|
|
263991
|
+
win.history.pushState(win.history.state, "", url);
|
|
263992
|
+
localAddressPushes += 1;
|
|
263993
|
+
} else {
|
|
263994
|
+
win.history.replaceState(win.history.state, "", url);
|
|
263995
|
+
}
|
|
263996
|
+
} catch {
|
|
263997
|
+
}
|
|
263998
|
+
}
|
|
263999
|
+
function postPlaceToHost(message, win = window) {
|
|
264000
|
+
if (win.parent !== win) {
|
|
264001
|
+
return (0, runtime2.postToHost)(message, win);
|
|
264002
|
+
}
|
|
264003
|
+
if (isValidPlaceFragment(message.fragment)) {
|
|
264004
|
+
writeLocalAddressBar(message.fragment, message.nav === "tab", win);
|
|
264005
|
+
}
|
|
264006
|
+
}
|
|
264007
|
+
function observeLocalAddressBar(onGoto, win = window) {
|
|
264008
|
+
let onChange = () => {
|
|
264009
|
+
let fragment = win.location.hash.slice(1);
|
|
264010
|
+
if (!isValidPlaceFragment(fragment) || fragment === localAddressPlace) {
|
|
264011
|
+
return;
|
|
264012
|
+
}
|
|
264013
|
+
localAddressPlace = fragment;
|
|
264014
|
+
onGoto(fragment);
|
|
264015
|
+
};
|
|
264016
|
+
win.addEventListener("popstate", onChange);
|
|
264017
|
+
win.addEventListener("hashchange", onChange);
|
|
264018
|
+
return () => {
|
|
264019
|
+
win.removeEventListener("popstate", onChange);
|
|
264020
|
+
win.removeEventListener("hashchange", onChange);
|
|
264021
|
+
};
|
|
264022
|
+
}
|
|
264023
|
+
async function copyLocalPageLink(fragment, win = window) {
|
|
264024
|
+
let url = new URL(win.location.href);
|
|
264025
|
+
url.hash = fragment;
|
|
264026
|
+
if (!await (0, runtime2.copyTextToClipboard)(url.href)) {
|
|
264027
|
+
return "clipboard_denied";
|
|
264028
|
+
}
|
|
264029
|
+
(0, runtime2.setInternalClipboard)(void 0);
|
|
264030
|
+
return null;
|
|
264031
|
+
}
|
|
263976
264032
|
function createPlaceLinkReporter(input = {}) {
|
|
263977
|
-
let value = input.post ??
|
|
264033
|
+
let value = input.post ?? postPlaceToHost, tabMove = false, value2 = input.enabled ?? placeLinkMessagesEnabled, callback = () => input.store === void 0 ? getPlaceLinkSessionStorage() : input.store, value3 = null, value4 = null, items = [], callback2 = () => {
|
|
263978
264034
|
if (value4 !== null) {
|
|
263979
264035
|
clearPlaceLinkTimeout(value4);
|
|
263980
264036
|
}
|
|
@@ -264044,9 +264100,7 @@ function installBridgePlaceLinks(runtime2) {
|
|
|
264044
264100
|
}
|
|
264045
264101
|
function subscribeGotoAnchorMessages(onGoto, hostWindow = window) {
|
|
264046
264102
|
if (hostWindow.parent === hostWindow) {
|
|
264047
|
-
return ()
|
|
264048
|
-
return;
|
|
264049
|
-
};
|
|
264103
|
+
return observeLocalAddressBar(onGoto, hostWindow);
|
|
264050
264104
|
}
|
|
264051
264105
|
let listener = (dataset) => {
|
|
264052
264106
|
if (dataset.source !== hostWindow.parent || !(0, runtime2.isAllowedHostMessageOrigin)(dataset.origin)) {
|
|
@@ -264266,6 +264320,9 @@ function installBridgePlaceLinks(runtime2) {
|
|
|
264266
264320
|
setPlaceLinkTimeout = (input, options) => setTimeout(input, options);
|
|
264267
264321
|
clearPlaceLinkTimeout = (input) => clearTimeout(input);
|
|
264268
264322
|
placeLinkMessagesEnabled = PLACE_LINK_MESSAGES_ENABLED;
|
|
264323
|
+
LOCAL_ADDRESS_PUSH_LIMIT = 20;
|
|
264324
|
+
localAddressPushes = 0;
|
|
264325
|
+
localAddressPlace = null;
|
|
264269
264326
|
};
|
|
264270
264327
|
}
|
|
264271
264328
|
|
|
@@ -268559,7 +268616,21 @@ function installEditorApp(runtime2) {
|
|
|
268559
268616
|
}, [shownSlideId, placeLinkPaused]);
|
|
268560
268617
|
let [copySlideLink] = runtime2.reactd0.useState(() => {
|
|
268561
268618
|
let copy = (0, runtime2.createPlaceLinkCopier)(
|
|
268562
|
-
(message) => void (0, runtime2.showToast)(message)
|
|
268619
|
+
(message) => void (0, runtime2.showToast)(message),
|
|
268620
|
+
// BaoCut: on claude.ai the frame shell says the link was copied; as the
|
|
268621
|
+
// top window the deck copied it itself (place-links.ts), so it says so here.
|
|
268622
|
+
(fragment) => (0, runtime2.requestCopyPageLink)(fragment).then((failure) => {
|
|
268623
|
+
if (failure === null && window.parent === window) {
|
|
268624
|
+
(0, runtime2.showToast)(
|
|
268625
|
+
(0, runtime2.formatMessage)({
|
|
268626
|
+
defaultMessage: "Link copied.",
|
|
268627
|
+
id: "9c1Cm+qXH3"
|
|
268628
|
+
}),
|
|
268629
|
+
3e3
|
|
268630
|
+
);
|
|
268631
|
+
}
|
|
268632
|
+
return failure;
|
|
268633
|
+
})
|
|
268563
268634
|
);
|
|
268564
268635
|
return (slideId) => copy((0, runtime2.slidePlaceFragment)(slideId));
|
|
268565
268636
|
});
|
|
@@ -918,13 +918,21 @@ function isTailnet(address) {
|
|
|
918
918
|
const m = /^100\.(\d{1,3})\./.exec(address);
|
|
919
919
|
return !!m && Number(m[1]) >= 64 && Number(m[1]) <= 127;
|
|
920
920
|
}
|
|
921
|
-
var isTunnel = (name) =>
|
|
921
|
+
var isTunnel = (name) => /(^|[^a-z0-9])(utun|tun|tap|wg|ppp|ipsec)\d*($|[^a-z0-9])/i.test(name) || /vpn|wintun|tunnel/i.test(name);
|
|
922
|
+
var ipv4Number = (address) => address.split(".").reduce((n, part) => n * 256 + Number(part), 0);
|
|
923
|
+
function isOwnNetwork(entry) {
|
|
924
|
+
if (!/^\d+\.\d+\.\d+\.\d+$/.test(entry.netmask)) return false;
|
|
925
|
+
const mask = ipv4Number(entry.netmask);
|
|
926
|
+
if (mask >= ipv4Number("255.255.255.252")) return true;
|
|
927
|
+
const address = ipv4Number(entry.address);
|
|
928
|
+
return ((address & mask) >>> 0) + 1 === address;
|
|
929
|
+
}
|
|
922
930
|
function lanAddresses() {
|
|
923
931
|
const out = /* @__PURE__ */ new Map();
|
|
924
932
|
for (const [name, list] of Object.entries(os2.networkInterfaces())) {
|
|
925
933
|
for (const entry of list ?? []) {
|
|
926
934
|
if (entry.family !== "IPv4" || entry.internal || entry.address.startsWith("169.254.") || isBenchmarkRange(entry.address)) continue;
|
|
927
|
-
const rank = isTailnet(entry.address) ? 2 : isTunnel(name) ? 1 : 0;
|
|
935
|
+
const rank = isTailnet(entry.address) ? 2 : isTunnel(name) || isOwnNetwork(entry) ? 1 : 0;
|
|
928
936
|
out.set(entry.address, Math.min(rank, out.get(entry.address) ?? rank));
|
|
929
937
|
}
|
|
930
938
|
}
|
|
@@ -939,7 +947,10 @@ function answers(host, port) {
|
|
|
939
947
|
};
|
|
940
948
|
socket.setTimeout(300, () => done(false));
|
|
941
949
|
socket.once("connect", () => done(true));
|
|
942
|
-
socket.once(
|
|
950
|
+
socket.once(
|
|
951
|
+
"error",
|
|
952
|
+
(error) => done(!["ECONNREFUSED", "EADDRNOTAVAIL", "EAFNOSUPPORT", "ENETUNREACH", "EHOSTUNREACH", "EACCES", "EPERM"].includes(error.code ?? ""))
|
|
953
|
+
);
|
|
943
954
|
});
|
|
944
955
|
}
|
|
945
956
|
async function answersAnyPort(address) {
|
|
@@ -985,6 +996,7 @@ function serverOrigin(host, port) {
|
|
|
985
996
|
return `http://${shown2}:${port}`;
|
|
986
997
|
}
|
|
987
998
|
var pagePathOf = (kind, root) => `/${kind}/${createHash("sha256").update(path2.resolve(root)).digest("base64url").slice(0, 22)}/`;
|
|
999
|
+
var pageGone = (dir, owner) => owner ? `This page's files are no longer in ${dir}: the skill was moved, renamed or removed while its server ran. Stop the server and open the artifact again (the agent that opened it can do both).` : "This page's files are gone from the computer that shares it. Ask whoever shared it to open it again.";
|
|
988
1000
|
function sendJson2(response, status, body, headers = {}) {
|
|
989
1001
|
const text = JSON.stringify(body);
|
|
990
1002
|
response.writeHead(status, {
|
|
@@ -4753,7 +4765,8 @@ data: ${JSON.stringify(event)}
|
|
|
4753
4765
|
const info = real === null ? null : await fsp4.lstat(real).catch(() => null);
|
|
4754
4766
|
if (file === null || real !== file || !info?.isFile()) {
|
|
4755
4767
|
if (realDist === null && !invalid && parts[0] === "index.html") {
|
|
4756
|
-
|
|
4768
|
+
stamp2(`the editor's files are gone from ${EDITOR_DIR}: the skill was moved, renamed or removed while this server ran`);
|
|
4769
|
+
response.writeHead(503, { "Content-Type": "text/plain; charset=utf-8", "Cache-Control": "no-store" }).end(pageGone(EDITOR_DIR, viewer.role === "owner"));
|
|
4757
4770
|
return;
|
|
4758
4771
|
}
|
|
4759
4772
|
response.writeHead(404, { "Cache-Control": "no-store" }).end();
|