@inkandswitch/patchwork-pkg-base 0.0.109 → 0.0.111
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/module-settings-url +1 -1
- package/package.json +1 -1
- package/packages/account-history/dist/assets/{HistoryRecorder-_3PrVW6n.js → HistoryRecorder-TRWDhOKO.js} +2 -3
- package/packages/account-history/dist/assets/HistoryRecorder-TRWDhOKO.js.map +1 -0
- package/packages/account-history/dist/assets/{index-DYqbrbYW.js → index-DBnlnSMc.js} +2 -2
- package/packages/account-history/dist/assets/{index-DYqbrbYW.js.map → index-DBnlnSMc.js.map} +1 -1
- package/packages/account-history/dist/index.js +1 -1
- package/packages/add-doc-to-sidebar-button/button.js +141 -25
- package/packages/add-doc-to-sidebar-button/button.test.js +114 -0
- package/packages/theming/dist/{active-theme-CC3CS64F.js → active-theme-6H5UANUR.js} +2 -2
- package/packages/theming/dist/{chunk-DH4YUYFJ.js → chunk-HHCCYVOT.js} +1 -2
- package/packages/theming/dist/chunk-HHCCYVOT.js.map +7 -0
- package/packages/theming/dist/main.js +3 -3
- package/packages/theming/dist/{theme-titlebar-BO2Y2GRN.js → theme-titlebar-UX4BND5Z.js} +2 -2
- package/packages/theming/dist/{theme-tray-V6BEXQWR.js → theme-tray-B477G2WR.js} +2 -2
- package/packages/theming/dist/tool.js +1 -1
- package/packages/threepane/dist/IsolatedDocumentArea-5WRK3TWL.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-22UEOQ6E.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-22UEOQ6E.js.map +7 -0
- package/packages/threepane/dist/{chunk-XOKWELWP.js → chunk-U4IJVHXK.js} +10 -5
- package/packages/threepane/dist/chunk-U4IJVHXK.js.map +7 -0
- package/packages/threepane/dist/index.js +1 -1
- package/plugin-registry-url +1 -1
- package/packages/account-history/dist/assets/HistoryRecorder-_3PrVW6n.js.map +0 -1
- package/packages/theming/dist/chunk-DH4YUYFJ.js.map +0 -7
- package/packages/threepane/dist/IsolatedDocumentArea-UTNJADQ7.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-U2TVLGCZ.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-U2TVLGCZ.js.map +0 -7
- package/packages/threepane/dist/chunk-XOKWELWP.js.map +0 -7
- /package/packages/theming/dist/{active-theme-CC3CS64F.js.map → active-theme-6H5UANUR.js.map} +0 -0
- /package/packages/theming/dist/{theme-titlebar-BO2Y2GRN.js.map → theme-titlebar-UX4BND5Z.js.map} +0 -0
- /package/packages/theming/dist/{theme-tray-V6BEXQWR.js.map → theme-tray-B477G2WR.js.map} +0 -0
- /package/packages/threepane/dist/{IsolatedDocumentArea-UTNJADQ7.js.map → IsolatedDocumentArea-5WRK3TWL.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-FW4363Y4.js";function a(){return new Promise(t=>setTimeout(t))}async function e(t){let{renderPatchworkFrame:o}=await import("./PatchworkFrame-
|
|
1
|
+
import"./chunk-FW4363Y4.js";function a(){return new Promise(t=>setTimeout(t))}async function e(t){let{renderPatchworkFrame:o}=await import("./PatchworkFrame-22UEOQ6E.js");return await a(),o(t)}var n=[{type:"patchwork:datatype",id:"account",name:"Patchwork Account",icon:"UserCircle",unlisted:!0,async load(){let{AccountDatatype:t}=await import("./datatypes-YDAECNBI.js");return t}},{type:"patchwork:datatype",id:"threepane:config",name:"Threepane Config",icon:"Settings",unlisted:!0,async load(){let{ThreepaneConfigDatatype:t}=await import("./datatypes-YDAECNBI.js");return t}},{type:"patchwork:tool",id:"threepane",tags:["frame-tool"],name:"Threepane",icon:"Window",supportedDatatypes:["account"],load:e},{type:"patchwork:tool",id:"threepane-wild-west",tags:["frame-tool"],name:"Threepane",icon:"Window",supportedDatatypes:["account"],load:e,unlisted:!0},{type:"patchwork:tool",id:"threepane-isolation",tags:["frame-tool"],name:"Threepane (isolate)",icon:"Window",supportedDatatypes:["account"],load:()=>e(!0),unlisted:!0},{type:"patchwork:component",id:"threepane-isolation-root",name:"Threepane Isolation Root",async load(){let{mountIsolationRoot:t}=await import("./IsolatedDocumentArea-5WRK3TWL.js");return await a(),t}},{type:"patchwork:tool",id:"patchwork-frame",name:"Patchwork Frame",icon:"Window",supportedDatatypes:["account"],unlisted:!0,load:e}];export{n as plugins};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/plugin-registry-url
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
automerge:
|
|
1
|
+
automerge:4EA4mxwxWigFfxawcVP3xc7o8mRK
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryRecorder-_3PrVW6n.js","sources":["../../node_modules/.pnpm/@inkandswitch+patchwork-providers-solid@0.2.8_@automerge+automerge-repo@2.6.0-subductio_67b137d5e2e338e4087baee1e2e96ad1/node_modules/@inkandswitch/patchwork-providers-solid/dist/index.js","../../src/HistoryRecorder.tsx"],"sourcesContent":["import { createEffect, createSignal, onCleanup, onMount, } from \"solid-js\";\nimport { createStore, reconcile } from \"solid-js/store\";\nimport * as Providers from \"@inkandswitch/patchwork-providers\";\nfunction resolveElement(source) {\n return typeof source === \"function\" ? source() : source;\n}\n/**\n * Generic reactive request. Resolves the first value a provider emits for\n * `selector` (via the one-shot `request` helper) and returns an accessor that\n * reads `undefined` until then. `T` is the response type.\n */\nexport function request(element, selector) {\n const [value, setValue] = createSignal(undefined);\n onMount(() => {\n const target = resolveElement(element);\n if (!target)\n return;\n Providers.request(target, selector).then((v) => {\n if (v == null)\n return;\n setValue(() => v);\n });\n });\n return value;\n}\nexport function subscribe(element, selector, initialValue) {\n const [value, setValue] = createSignal(initialValue);\n onMount(() => {\n const target = resolveElement(element);\n if (!target)\n return;\n const unsubscribe = Providers.subscribe(target, selector, setValue);\n onCleanup(unsubscribe);\n });\n return value;\n}\n/**\n * Store-backed subscription. Use this when a consumer wants Solid's\n * fine-grained nested reactivity for incoming JSON object or array snapshots.\n * Requires an initial object/array so the store has a stable root.\n *\n * `reconcile` preserves stable object/array identity where possible, so this\n * helper is not a good fit when the top-level value is used as an identity key\n * for resources or memos.\n */\nexport function subscribeReconciled(element, selector, initialValue) {\n const [store, setStore] = createStore(initialValue);\n onMount(() => {\n const target = resolveElement(element);\n if (!target)\n return;\n const unsubscribe = Providers.subscribe(target, selector, (v) => {\n setStore(reconcile(v));\n });\n onCleanup(unsubscribe);\n });\n return store;\n}\n/**\n * Handle-specialized subscription. Use when the answering provider emits an\n * `AutomergeUrl`. The handle is recovered locally from the global repo\n * (`window.repo`), so it stays fully live — reads project reactively and writes go\n * straight back to the same repo. Returns `[doc, handle]` matching the shape\n * of `solid-automerge`'s `useDocument`; both read `undefined` until the first\n * url arrives. `T` is the doc shape inside the handle.\n */\nexport function subscribeDoc(element, selector) {\n const [handle, setHandle] = createSignal(undefined);\n onMount(() => {\n const target = resolveElement(element);\n if (!target)\n return;\n let canceled = false;\n const unsubscribe = Providers.subscribe(target, selector, (url) => {\n if (!url)\n return;\n const repo = \"repo\" in window ? window.repo : undefined;\n if (!repo)\n return;\n void Promise.resolve(repo.find(url)).then((h) => {\n if (canceled)\n return;\n setHandle(() => h);\n });\n });\n onCleanup(() => {\n canceled = true;\n unsubscribe();\n });\n });\n // Mirror the doc into a store by `reconcile`-ing against the *materialized*\n // snapshot (`handle.doc()`) on every change, rather than replaying the\n // change's incremental patches (as `solid-automerge`'s `createDocumentProjection`\n // / `autoproduce` does).\n //\n // A whole-value write such as `doc.list = [...]` is lowered by Automerge to\n // `putObjectFromHydrate`, whose patch stream is a `put` that materializes the\n // new container *plus* per-element `insert` patches. Replaying that delta with\n // `applyPatches` double-applies the contents — the `put` seeds `[a, b]`, then\n // the inserts splice `a, b` in again, yielding `[a, b, a, b]` — even though the\n // document itself is correct. The materialized snapshot is always\n // authoritative, so reconciling against it is robust to any valid change,\n // whole-array reassignment included.\n const [store, setStore] = createStore({});\n const [ready, setReady] = createSignal(false);\n createEffect(() => {\n const h = handle();\n if (!h) {\n setReady(false);\n return;\n }\n const sync = () => {\n setStore(reconcile((h.doc() ?? {})));\n setReady(true);\n };\n sync();\n h.on(\"change\", sync);\n onCleanup(() => h.off(\"change\", sync));\n });\n const doc = () => (ready() ? store : undefined);\n return [doc, handle];\n}\n","import { onMount, onCleanup, createEffect } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { type AutomergeUrl } from \"@automerge/automerge-repo/slim\";\nimport type { ToolImplementation } from \"@inkandswitch/patchwork-plugins\";\nimport \"./index.css\";\nimport { OpenDocumentEvent } from \"@inkandswitch/patchwork-elements\";\nimport {\n getType,\n type HasPatchworkMetadata,\n} from \"@inkandswitch/patchwork-filesystem\";\nimport {\n getFallbackTool,\n getRegistry,\n type DatatypeDescription,\n type DatatypeImplementation,\n} from \"@inkandswitch/patchwork-plugins\";\nimport { subscribeDoc } from \"@inkandswitch/patchwork-providers-solid\";\nimport {\n ACCOUNT_HISTORY_DATATYPE,\n DEDUPLICATION_TIME_THRESHOLD,\n VIEWER_TOOL_ID,\n} from \"./constants.ts\";\nimport {\n type PatchworkToolProps,\n type HistoryDoc,\n type HistoryEntry,\n} from \"./types.ts\";\n\n// Key under which this tool's private storage doc is registered — see the\n// `patchwork:tool-storage` provider (patchwork-base/providers). Mounted as a\n// titlebar-tool, this component is bound to whatever *document* is focused,\n// not the account, so it can't reach its own storage via `props.handle`; the\n// provider gives it a private, account-scoped doc instead.\nconst TOOL_STORAGE_ID = \"account-history\";\n\nexport function HistoryRecorder(props: PatchworkToolProps<any>) {\n // Resolves (and, on first use, creates) this tool's private storage doc.\n // The provider only guarantees an empty doc exists — the shape below\n // (`entries`, `title`, `@patchwork`) is seeded by us the first time it's\n // used.\n const [historyDoc, historyHandle] = subscribeDoc<HistoryDoc>(\n props.element,\n { type: \"patchwork:tool-storage\", toolId: TOOL_STORAGE_ID }\n );\n\n const historyUrl = () => historyHandle()?.url;\n\n createEffect(() => {\n const handle = historyHandle();\n const doc = historyDoc();\n if (!handle || !doc || Array.isArray(doc.entries)) return;\n handle.change((d) => {\n if (Array.isArray(d.entries)) return; // lost an initialization race\n d[\"@patchwork\"] = { type: ACCOUNT_HISTORY_DATATYPE };\n d.title = \"Account History\";\n d.entries = [];\n });\n });\n\n onMount(() => {\n const onDocumentOpened = async (event: Event) => {\n const openEvent = event as OpenDocumentEvent;\n const { url: rawUrl, toolId: rawToolId } = openEvent.detail;\n const [docUrl, ...heads] = rawUrl.split(\"#\");\n const url = docUrl as AutomergeUrl;\n let toolId = rawToolId;\n\n // Get document to extract title and type\n const docHandle = await props.repo.find(url);\n await docHandle.whenReady();\n const doc = docHandle.doc();\n\n if (!doc) {\n console.warn(\"HistoryRecorder: failed to load document\");\n return;\n }\n\n const datatype = getType(doc as Partial<HasPatchworkMetadata>);\n\n if (!toolId) {\n // if the tool id isn't defined, use the current fallback tool\n if (!datatype) {\n console.warn(\n \"HistoryRecorder: no tool found for document type; skipping history recording\"\n );\n return;\n }\n const fallbackTool = getFallbackTool(doc as HasPatchworkMetadata);\n if (!fallbackTool) {\n console.warn(\n \"HistoryRecorder: no tool found for document type; skipping history recording\"\n );\n return;\n }\n toolId = fallbackTool.id;\n }\n\n if (datatype === ACCOUNT_HISTORY_DATATYPE) {\n return; // Don't record when opening account history documents\n }\n\n const currentHistoryHandle = historyHandle();\n if (!currentHistoryHandle) {\n console.warn(\"HistoryRecorder: history handle not ready yet\");\n return;\n }\n const historyDocSnapshot = currentHistoryHandle.doc();\n if (!historyDocSnapshot) {\n console.warn(\"HistoryRecorder: history document not ready yet\");\n return;\n }\n\n // Deduplication: check if this entry is a duplicate from rapid clicks\n const lastEntry =\n historyDocSnapshot.entries[historyDocSnapshot.entries.length - 1];\n if (\n lastEntry &&\n lastEntry.docUrl === url &&\n lastEntry.toolId === toolId &&\n Date.now() - lastEntry.timestamp < DEDUPLICATION_TIME_THRESHOLD\n ) {\n return; // Skip recording - duplicate from rapid clicking\n }\n\n // Extract title\n let docTitle = \"Untitled\";\n if (datatype) {\n const registry = getRegistry<DatatypeDescription>(\"patchwork:datatype\");\n const loaded = registry.get(datatype);\n if (loaded && \"module\" in loaded) {\n const impl = loaded.module as DatatypeImplementation;\n try {\n docTitle = impl.getTitle(doc) || \"Untitled\";\n } catch {\n // getTitle may fail if the document shape doesn't match the datatype\n }\n }\n }\n\n // Get current heads, unless the URL specified a head\n let entryHeads = heads;\n if (entryHeads.length === 0) entryHeads = docHandle.heads();\n\n // Create new entry\n const newEntry: HistoryEntry = {\n timestamp: Date.now(),\n docUrl: url,\n docTitle,\n docType: datatype || \"unknown\",\n toolId,\n heads: entryHeads,\n };\n\n // Add entry to history\n currentHistoryHandle.change((doc) => {\n doc.entries.push(newEntry);\n });\n };\n\n // Listen to patchwork:open-document events (should fire once per user action)\n document.addEventListener(\n \"patchwork:open-document\",\n onDocumentOpened as EventListener,\n { capture: true }\n );\n\n onCleanup(() => {\n document.removeEventListener(\n \"patchwork:open-document\",\n onDocumentOpened as EventListener,\n { capture: true }\n );\n });\n });\n\n const openHistory = () => {\n const currentHistoryUrl = historyUrl();\n if (!currentHistoryUrl) {\n console.warn(\"HistoryRecorder: no history URL yet\");\n return;\n }\n\n // Dispatch open document event\n props.element.dispatchEvent(\n new OpenDocumentEvent({\n url: currentHistoryUrl,\n toolId: VIEWER_TOOL_ID,\n })\n );\n };\n\n return (\n <button\n onClick={openHistory}\n class=\"account-history-toolbar-button\"\n title=\"Open account history\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n </button>\n );\n}\n\nexport const renderHistoryRecorder: ToolImplementation<any> = (\n handle,\n element\n) => render(() => <HistoryRecorder handle={handle} repo={element.repo} element={element} />, element);\n"],"names":["TOOL_STORAGE_ID","HistoryRecorder","props","historyDoc","historyHandle","subscribeDoc","element","type","toolId","historyUrl","url","createEffect","handle","doc","Array","isArray","entries","change","d","ACCOUNT_HISTORY_DATATYPE","title","onMount","onDocumentOpened","event","openEvent","rawUrl","rawToolId","detail","docUrl","heads","split","docHandle","repo","find","whenReady","console","warn","datatype","getType","fallbackTool","getFallbackTool","id","currentHistoryHandle","historyDocSnapshot","lastEntry","length","Date","now","timestamp","DEDUPLICATION_TIME_THRESHOLD","docTitle","registry","getRegistry","loaded","get","impl","module","getTitle","entryHeads","newEntry","docType","push","document","addEventListener","capture","onCleanup","removeEventListener","openHistory","currentHistoryUrl","dispatchEvent","OpenDocumentEvent","VIEWER_TOOL_ID","_el$","_tmpl$","$$click","renderHistoryRecorder","render","_$createComponent","_$delegateEvents"],"mappings":";;;;;;;;;AAGA,SAAS,eAAe,QAAQ;AAC5B,SAAO,OAAO,WAAW,aAAa,OAAM,IAAK;AACrD;AA6DO,SAAS,aAAa,SAAS,UAAU;AAC5C,QAAM,CAAC,QAAQ,SAAS,IAAI,aAAa,MAAS;AAClD,UAAQ,MAAM;AACV,UAAM,SAAS,eAAe,OAAO;AACrC,QAAI,CAAC;AACD;AACJ,QAAI,WAAW;AACf,UAAM,cAAc,UAAU,UAAU,QAAQ,UAAU,CAAC,QAAQ;AAC/D,UAAI,CAAC;AACD;AACJ,YAAM,OAAO,UAAU,SAAS,OAAO,OAAO;AAC9C,UAAI,CAAC;AACD;AACJ,WAAK,QAAQ,QAAQ,KAAK,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,MAAM;AAC7C,YAAI;AACA;AACJ,kBAAU,MAAM,CAAC;AAAA,MACrB,CAAC;AAAA,IACL,CAAC;AACD,cAAU,MAAM;AACZ,iBAAW;AACX,kBAAW;AAAA,IACf,CAAC;AAAA,EACL,CAAC;AAcD,QAAM,CAAC,OAAO,QAAQ,IAAI,YAAY,CAAA,CAAE;AACxC,QAAM,CAAC,OAAO,QAAQ,IAAI,aAAa,KAAK;AAC5C,eAAa,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"version": 3,
|
|
3
|
-
"sources": ["../src/active-theme.ts"],
|
|
4
|
-
"sourcesContent": ["import {getRegistry} from \"@inkandswitch/patchwork-plugins\"\nimport themeCssUrl from \"./theme.css\"\nimport lycheeCssUrl from \"./lychee.css\"\nimport gloomCssUrl from \"./gloom.css\"\n\ntype ActiveThemeState = {\n\tmode: \"light\" | \"dark\"\n\tthemeId: string\n\tlight: string\n\tdark: string\n\tpreferencesUrl?: string\n}\n\ntype ThemePreferencesHandle = {\n\turl?: string\n\tdoc(): any\n\tchange(fn: (doc: any) => void): void\n\ton?(event: \"change\", listener: () => void): void\n\toff?(event: \"change\", listener: () => void): void\n\twhenReady?(): Promise<unknown>\n}\n\nexport const CURRENT_THEME_SELECTOR = \"patchwork:current-theme\"\n\n/**\n * Which themes an account that has not chosen one starts on. A site states\n * this on its root element \u2014 `<html data-theme-light=\"warm\" data-theme-dark=\"dark\">`\n * \u2014 so the answer comes from the site itself rather than from whichever\n * module happened to load last. `lychee`/`gloom` apply when it says nothing.\n *\n * Nothing is written to the preferences document: an unset preference resolves\n * through here at read time, so the theme a user picked explicitly is never\n * overwritten, and a site changing its defaults moves everyone who never\n * picked one.\n */\nconst FALLBACK_DEFAULTS = {light: \"lychee\", dark: \"gloom\"}\n\nfunction defaultThemeIds() {\n\tconst root = document.documentElement\n\treturn {\n\t\tlight: root.getAttribute(\"data-theme-light\") || FALLBACK_DEFAULTS.light,\n\t\tdark: root.getAttribute(\"data-theme-dark\") || FALLBACK_DEFAULTS.dark,\n\t}\n}\n\nconst bundledStyleUrls = [themeCssUrl, lycheeCssUrl, gloomCssUrl].map(\n\t(href) => new URL(href, import.meta.url).href\n)\nconst bundledStyles = new Set(bundledStyleUrls)\nconst themeLinks = new Map<string, HTMLLinkElement>()\nconst listeners = new Set<(state: ActiveThemeState) => void>()\n\nlet started = false\nlet stylesBootstrapped = false\nlet currentPrefsHandle: ThemePreferencesHandle | undefined\nlet currentState: ActiveThemeState | undefined\nlet storageStarted = false\nlet storageElement: HTMLElement | undefined\nlet unsubscribeStorage: (() => void) | undefined\nlet unsubscribePrefsChange: (() => void) | undefined\n\nconst TOOL_STORAGE_ID = \"theme-preferences\"\n\nfunction ensureThemeLink(style: string) {\n\tif (themeLinks.has(style)) return\n\tconst link = document.createElement(\"link\")\n\tlink.rel = \"stylesheet\"\n\tlink.href = style\n\tdocument.head.appendChild(link)\n\tthemeLinks.set(style, link)\n}\n\nfunction removeThemeLink(style: string) {\n\tconst link = themeLinks.get(style)\n\tif (link) {\n\t\tlink.remove()\n\t\tthemeLinks.delete(style)\n\t}\n}\n\nfunction getMode(): \"light\" | \"dark\" {\n\treturn window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n\t\t? \"dark\"\n\t\t: \"light\"\n}\n\nfunction getPreferredThemeId(prefs: any): string {\n\tconst mode = getMode()\n\tconst themeId = prefs ? (mode === \"dark\" ? prefs.dark : prefs.light) : undefined\n\treturn themeId || defaultThemeIds()[mode]\n}\n\nfunction snapshot(): ActiveThemeState {\n\tconst prefs = currentPrefsHandle?.doc()\n\tconst mode = getMode()\n\tconst defaults = defaultThemeIds()\n\treturn {\n\t\tmode,\n\t\tthemeId: getPreferredThemeId(prefs),\n\t\tlight: prefs?.light || defaults.light,\n\t\tdark: prefs?.dark || defaults.dark,\n\t\tpreferencesUrl: currentPrefsHandle?.url,\n\t}\n}\n\nfunction emit() {\n\tcurrentState = snapshot()\n\tfor (const listener of listeners) listener(currentState)\n}\n\nfunction applyTheme(themeId: string) {\n\tif (themeId) document.documentElement.setAttribute(\"theme\", themeId)\n}\n\nfunction applyFromPrefs() {\n\tapplyTheme(getPreferredThemeId(currentPrefsHandle?.doc()))\n\temit()\n}\n\nfunction subscribeToProvider<T>(\n\telement: HTMLElement,\n\tselector: Record<string, unknown>,\n\tonValue: (value: T) => void\n) {\n\tconst view = element.closest(\"patchwork-view\")\n\tconst dispatchElement = (view as HTMLElement) ?? element\n\tconst channel = new MessageChannel()\n\tconst port = channel.port2\n\tconst controller = new AbortController()\n\n\tport.addEventListener(\n\t\t\"message\",\n\t\t(event: MessageEvent) => {\n\t\t\tif ((event.data as any)?.type === \"change\") onValue((event.data as any).value as T)\n\t\t},\n\t\t{signal: controller.signal}\n\t)\n\tport.start()\n\n\tdispatchElement.dispatchEvent(\n\t\tnew CustomEvent(\"patchwork:subscribe\", {\n\t\t\tdetail: {selector, port: channel.port1},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t})\n\t)\n\n\treturn () => {\n\t\tif (controller.signal.aborted) return\n\t\tcontroller.abort()\n\t\ttry {\n\t\t\tport.postMessage({type: \"unsubscribe\"})\n\t\t} catch {}\n\t\ttry {\n\t\t\tport.close()\n\t\t} catch {}\n\t}\n}\n\nfunction ensureThemePreferencesShape(prefsHandle: ThemePreferencesHandle) {\n\tprefsHandle.change((doc: any) => {\n\t\tdoc[\"@patchwork\"] = {type: \"theme-preferences\"}\n\t})\n}\n\nasync function useThemePreferencesHandle(prefsHandle: ThemePreferencesHandle) {\n\tawait prefsHandle.whenReady?.()\n\tensureThemePreferencesShape(prefsHandle)\n\n\tif (currentPrefsHandle === prefsHandle) return\n\tif (\n\t\tcurrentPrefsHandle?.url &&\n\t\tprefsHandle.url &&\n\t\tcurrentPrefsHandle.url === prefsHandle.url\n\t) {\n\t\treturn\n\t}\n\n\tunsubscribePrefsChange?.()\n\tcurrentPrefsHandle = prefsHandle\n\tapplyFromPrefs()\n\n\tprefsHandle.on?.(\"change\", applyFromPrefs)\n\tunsubscribePrefsChange = () => prefsHandle.off?.(\"change\", applyFromPrefs)\n}\n\nasync function useToolStoragePreferences(element: HTMLElement, storageUrl: string) {\n\tconst repo = (element as any).repo ?? (window as any).repo\n\tif (!repo) return\n\n\tconst prefsHandle = await repo.find(storageUrl)\n\tawait useThemePreferencesHandle(prefsHandle)\n}\n\nfunction connectThemePreferences(element: HTMLElement) {\n\tif (currentPrefsHandle) return\n\tif (storageStarted && storageElement === element) return\n\n\tunsubscribeStorage?.()\n\tstorageStarted = true\n\tstorageElement = element\n\n\tlet lastStorageUrl: string | undefined\n\n\tunsubscribeStorage = subscribeToProvider<string | undefined>(\n\t\telement,\n\t\t{type: \"patchwork:tool-storage\", toolId: TOOL_STORAGE_ID},\n\t\t(storageUrl) => {\n\t\t\tif (!storageUrl || storageUrl === lastStorageUrl) return\n\t\t\tlastStorageUrl = storageUrl\n\t\t\tuseToolStoragePreferences(element, storageUrl).catch(() => {\n\t\t\t\t// Theme preferences are best-effort; keep the default theme.\n\t\t\t})\n\t\t}\n\t)\n}\n\nfunction watchThemeRegistry() {\n\tconst themeRegistry = getRegistry(\"patchwork:theme\") as any\n\n\tfor (const theme of themeRegistry.all?.() || []) {\n\t\tif (theme.style) ensureThemeLink(theme.style)\n\t}\n\n\tthemeRegistry.on(\"registered\", (plugin: any) => {\n\t\tif (plugin.style) ensureThemeLink(plugin.style)\n\t})\n\tthemeRegistry.on(\"removed\", () => {\n\t\tconst knownStyles = new Set(\n\t\t\t(themeRegistry.all?.() || [])\n\t\t\t\t.map((t: any) => t.style)\n\t\t\t\t.filter(Boolean)\n\t\t)\n\t\tfor (const [style] of themeLinks) {\n\t\t\tif (!bundledStyles.has(style) && !knownStyles.has(style)) {\n\t\t\t\tremoveThemeLink(style)\n\t\t\t}\n\t\t}\n\t})\n}\n\n// Load the bundled theme stylesheets and keep the registry-provided ones in\n// sync. Idempotent \u2014 safe to call from every entry point. This is the CSS side\n// of theming, independent of where the *active* theme id is sourced from.\nfunction bootstrapThemeStyles() {\n\tif (stylesBootstrapped) return\n\tstylesBootstrapped = true\n\tfor (const href of bundledStyleUrls) ensureThemeLink(href)\n\twatchThemeRegistry()\n}\n\nexport function startActiveTheme(\n\telement?: HTMLElement,\n\tpreferencesHandle?: ThemePreferencesHandle\n) {\n\tif (preferencesHandle) {\n\t\tuseThemePreferencesHandle(preferencesHandle).catch(() => {\n\t\t\t// Theme preferences are best-effort; keep the default theme.\n\t\t})\n\t} else if (element) {\n\t\tconnectThemePreferences(element)\n\t}\n\tif (started) return\n\tstarted = true\n\n\tbootstrapThemeStyles()\n\tapplyFromPrefs()\n\n\twindow\n\t\t.matchMedia(\"(prefers-color-scheme: dark)\")\n\t\t.addEventListener(\"change\", applyFromPrefs)\n}\n\n/**\n * Drive the active theme from a `patchwork:current-theme` provider instead of\n * from local preferences. Used by the titlebar theme tool, which runs isolated\n * and mirrors whatever theme the host is showing: it applies each theme id the\n * provider emits and re-applies whenever that value changes.\n *\n * Stylesheets are still loaded locally so the referenced themes render; only\n * the *choice* of active theme comes from the provider. Deliberately does not\n * wire up preferences or the prefers-color-scheme listener \u2014 those would fight\n * the provider for control of the `theme` attribute.\n *\n * @returns an unsubscribe function.\n */\nexport function startActiveThemeFromProvider(element: HTMLElement) {\n\tbootstrapThemeStyles()\n\n\treturn subscribeToProvider<string | ActiveThemeState | undefined>(\n\t\telement,\n\t\t{type: CURRENT_THEME_SELECTOR},\n\t\t(value) => {\n\t\t\tconst themeId = typeof value === \"string\" ? value : value?.themeId\n\t\t\tif (themeId) applyTheme(themeId)\n\t\t}\n\t)\n}\n\ntype CurrentThemeSubscribeEvent = CustomEvent<{\n\tselector: {type: string; [key: string]: unknown}\n\tport: MessagePort\n}>\n\n/**\n * Answer `patchwork:current-theme` subscriptions with the active theme id,\n * pushing a fresh value whenever the theme changes. This is the host-side\n * counterpart to {@link startActiveThemeFromProvider}: it lets isolated tools\n * (the titlebar theme tool) mirror the host's active theme across the isolation\n * boundary, where the theme is relayed by the providers bridge.\n *\n * The listener is installed on the given root (the theme tray installs it on\n * `document.documentElement`) so that bridged `patchwork:subscribe` events \u2014\n * which bubble up to `<html>` \u2014 reach it. Implements the provider port protocol\n * directly to avoid a dependency on `@inkandswitch/patchwork-providers`.\n *\n * @returns an unsubscribe function that removes the listener and tears down any\n * live subscriptions.\n */\nexport function serveCurrentThemeProvider(root: HTMLElement): () => void {\n\tconst responders = new Set<() => void>()\n\n\tconst onSubscribe = (event: Event) => {\n\t\tconst detail = (event as CurrentThemeSubscribeEvent).detail\n\t\tif (!detail || detail.selector?.type !== CURRENT_THEME_SELECTOR) return\n\t\tevent.stopPropagation()\n\n\t\tconst port = detail.port\n\t\tlet alive = true\n\t\tconst emit = () => {\n\t\t\tif (!alive) return\n\t\t\tport.postMessage({type: \"change\", value: getActiveThemeState().themeId})\n\t\t}\n\t\tconst removeThemeListener = onActiveThemeChange(emit)\n\n\t\tconst stop = () => {\n\t\t\tif (!alive) return\n\t\t\talive = false\n\t\t\tremoveThemeListener()\n\t\t\tresponders.delete(stop)\n\t\t\ttry {\n\t\t\t\tport.close()\n\t\t\t} catch {}\n\t\t}\n\t\tresponders.add(stop)\n\n\t\tport.onmessage = (e: MessageEvent) => {\n\t\t\tif ((e.data as any)?.type === \"unsubscribe\") stop()\n\t\t}\n\t\tport.start?.()\n\t}\n\n\troot.addEventListener(\"patchwork:subscribe\", onSubscribe)\n\n\treturn () => {\n\t\troot.removeEventListener(\"patchwork:subscribe\", onSubscribe)\n\t\tfor (const stop of [...responders]) stop()\n\t}\n}\n\nexport function getActiveThemeState() {\n\treturn currentState || snapshot()\n}\n\n/**\n * Best-effort color scheme for a theme. Prefers the plugin's declared\n * `colorScheme`, otherwise sniffs `color-scheme: light|dark` out of the theme's\n * stylesheet. Returns `undefined` when neither is available (treated as\n * scheme-agnostic by callers). Shared by the theme tray and the theme picker\n * tool so they group light/dark themes the same way.\n */\nexport async function detectColorScheme(theme: {\n\tcolorScheme?: \"light\" | \"dark\"\n\tstyle?: string\n}): Promise<\"light\" | \"dark\" | undefined> {\n\tif (theme.colorScheme) return theme.colorScheme\n\tif (!theme.style) return undefined\n\ttry {\n\t\tconst res = await fetch(theme.style)\n\t\tconst css = await res.text()\n\t\tconst match = css.match(/color-scheme:\\s*(light|dark)/)\n\t\treturn (match?.[1] as \"light\" | \"dark\") ?? undefined\n\t} catch {\n\t\treturn undefined\n\t}\n}\n\nexport function setThemeForCurrentMode(themeId: string) {\n\tconst mode = getMode()\n\tsetThemeForMode(mode, themeId)\n}\n\nexport function setThemeForMode(mode: \"light\" | \"dark\", themeId: string) {\n\tcurrentPrefsHandle?.change((doc: any) => {\n\t\tdoc[mode] = themeId\n\t})\n}\n\nexport function hasThemePreferences() {\n\treturn Boolean(currentPrefsHandle)\n}\n\nexport function onActiveThemeChange(listener: (state: ActiveThemeState) => void) {\n\tlisteners.add(listener)\n\tlistener(getActiveThemeState())\n\treturn () => listeners.delete(listener)\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAAA,SAAQ,mBAAkB;;;;;;AAsBnB,IAAM,yBAAyB;AAatC,IAAM,oBAAoB,EAAC,OAAO,UAAU,MAAM,QAAO;AAEzD,SAAS,kBAAkB;AAC1B,QAAM,OAAO,SAAS;AACtB,SAAO;AAAA,IACN,OAAO,KAAK,aAAa,kBAAkB,KAAK,kBAAkB;AAAA,IAClE,MAAM,KAAK,aAAa,iBAAiB,KAAK,kBAAkB;AAAA,EACjE;AACD;AAEA,IAAM,mBAAmB,CAAC,eAAa,gBAAc,aAAW,EAAE;AAAA,EACjE,CAAC,SAAS,IAAI,IAAI,MAAM,YAAY,GAAG,EAAE;AAC1C;AACA,IAAM,gBAAgB,IAAI,IAAI,gBAAgB;AAC9C,IAAM,aAAa,oBAAI,IAA6B;AACpD,IAAM,YAAY,oBAAI,IAAuC;AAE7D,IAAI,UAAU;AACd,IAAI,qBAAqB;AACzB,IAAI;AACJ,IAAI;AACJ,IAAI,iBAAiB;AACrB,IAAI;AACJ,IAAI;AACJ,IAAI;AAEJ,IAAM,kBAAkB;AAExB,SAAS,gBAAgB,OAAe;AACvC,MAAI,WAAW,IAAI,KAAK,EAAG;AAC3B,QAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,OAAK,MAAM;AACX,OAAK,OAAO;AACZ,WAAS,KAAK,YAAY,IAAI;AAC9B,aAAW,IAAI,OAAO,IAAI;AAC3B;AAEA,SAAS,gBAAgB,OAAe;AACvC,QAAM,OAAO,WAAW,IAAI,KAAK;AACjC,MAAI,MAAM;AACT,SAA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AAQ,QAAQ,CAAC,KAA0B;AAAA,EAC5C,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AAEO,SAAS,uBAAuB,SAAiB;AACvD,QAAM,OAAO,QAAQ;AACrB,kBAAgB,MAAM,OAAO;AAC9B;AAEO,SAAS,gBAAgB,MAAwB,SAAiB;AACxE,sBAAoB,OAAO,CAAC,QAAa;AACxC,QAAI,IAAI,IAAI;AAAA,EACb,CAAC;AACF;AAEO,SAAS,sBAAsB;AACrC,SAAO,QAAQ,kBAAkB;AAClC;AAEO,SAAS,oBAAoB,UAA6C;AAChF,YAAU,IAAI,QAAQ;AACtB,WAAS,oBAAoB,CAAC;AAC9B,SAAO,MAAM,UAAU,OAAO,QAAQ;AACvC;",
|
|
6
|
-
"names": ["emit"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as M,b as ce,c as H,d as U}from"./chunk-YERFWP5I.js";import{a as Ie,b as B,c as j,d as te,e as re,f as oe,g as ne,h as ie,i as ae,j as le,k as se,l as P,m as F,n as W,o as de,p as ue,q as me,r as fe}from"./chunk-XOKWELWP.js";import{b as Ue}from"./chunk-FW4363Y4.js";import{template as _}from"solid-js/web";import{delegateEvents as et}from"solid-js/web";import{memo as tt}from"solid-js/web";import{setStyleProperty as rt}from"solid-js/web";import{setAttribute as Y}from"solid-js/web";import{effect as R}from"solid-js/web";import{getOwner as k}from"solid-js/web";import{use as C}from"solid-js/web";import{insert as v}from"solid-js/web";import{createComponent as m}from"solid-js/web";import"@inkandswitch/patchwork-elements";import{subscribe as ft}from"@inkandswitch/patchwork-providers";import{template as q}from"solid-js/web";import{delegateEvents as Re}from"solid-js/web";import{memo as Le}from"solid-js/web";import{insert as pe}from"solid-js/web";import{createComponent as I}from"solid-js/web";import{For as Pe,Show as z}from"solid-js";var Ae=q("<div class=threepane-widgets>"),xe=q("<div class=threepane-widgets__empty><button type=button class=threepane-widgets__add>\uFF0B Add document list"),Oe=q("<div class=threepane-widget>");function he(e){let l=()=>{let o=e.rootFolderUrl(),a=e.configHandle();!o||!a||a.change(r=>{r.sidebar.widgets.push([H,o])})};return(()=>{var o=Ae();return pe(o,I(z,{get when(){return e.ready()},get children(){return I(z,{get when(){return e.widgets().length},get fallback(){return I(z,{get when(){return Le(()=>!!e.rootFolderUrl())()&&e.configHandle()},get children(){var a=xe(),r=a.firstChild;return r.$$click=l,a}})},get children(){return I(Pe,{get each(){return e.widgets()},children:a=>(()=>{var r=Oe();return pe(r,I(W,{slot:a})),r})()})}})}})),o})()}Re(["click"]);import{template as we}from"solid-js/web";import{setAttribute as Fe}from"solid-js/web";import{effect as We}from"solid-js/web";import{insert as ge}from"solid-js/web";import{createComponent as K}from"solid-js/web";import{For as Ne,Show as Ve}from"solid-js";var Me=we("<div class=frame-tray>"),He=we("<div class=frame-tray__item>");function ve(e){return K(Ve,{get when(){return e.slots().length},get children(){var l=Me();return ge(l,K(Ne,{get each(){return F(e.slots())},children:o=>(()=>{var a=He();return ge(a,K(W,{slot:o})),We(()=>Fe(a,"data-tray-id",P(o))),a})()})),l}})}import{createEffect as V,createMemo as pt,createSignal as b,onCleanup as L,onMount as ke,Show as S}from"solid-js";import{render as ht}from"solid-js/web";import{createDocOfDatatype2 as je}from"@inkandswitch/patchwork-plugins";import{getRegistry as Be}from"@inkandswitch/patchwork-plugins";function N(e){return Be("patchwork:datatype").loadWhenReady(e)}var ze=new Set(["document-title","spacer"]);function _e(e){return e?[[H,e]]:[]}function qe(e,l){if(!((e.version??0)>=1)){if(e.sidebar||(e.sidebar={widgets:[]}),l&&!e.sidebar.widgets?.length&&(e.sidebar.widgets=_e(l)),!e.tray)e.tray=M.slice();else{let o=F(e.tray);o.length!==e.tray.length&&(e.tray=o);let a=new Set(e.tray.map(r=>P(r)));for(let r of M)a.has(r)||(e.tray.push(r),a.add(r))}e.doctitle?.tools?.length||(e.doctitle={...e.doctitle,tools:ce.slice()}),!(!e.sidebar.widgets?.length&&!l)&&(e.version=1)}}async function ye(e,l){let o=e.doc()?.rootFolderUrl,a=e.doc()?.tools?.threepane;if(a){let i=await l.find(a);if((i.doc()?.version??0)>=1)return;i.change(u=>qe(u,o));return}let r=await N("threepane:config");if(!r){console.warn("frame: threepane:config datatype never registered");return}if(e.doc()?.tools?.threepane)return;let t=e.doc(),n=(t?.documentToolbarToolIds??[]).filter(i=>!ze.has(i)),s=await je(r,l);s.change(i=>{n.length&&(i.doctitle.tools=n),i.sidebar.widgets=_e(t?.rootFolderUrl),i.tray||(i.tray=M.slice()),t?.rootFolderUrl?i.version=1:delete i.version}),e.change(i=>{i.tools||(i.tools={}),i.tools.threepane||(i.tools.threepane=s.url)})}var Se=Ue(Ie(),1);import{createDocOfDatatype2 as Ke}from"@inkandswitch/patchwork-plugins";var g=(0,Se.default)("patchwork:threepane:examples");async function $e(e,l){let o=e.doc();if(!o?.rootFolderUrl){g("skipped \u2014 account has no rootFolderUrl");return}if(o.exampleDocsSeededAt){g("skipped \u2014 already ran for this account at",new Date(o.exampleDocsSeededAt).toISOString());return}g("claiming marker on account",e.url),e.change(d=>{d.exampleDocsSeededAt||(d.exampleDocsSeededAt=Date.now())});let a=await l.find(o.rootFolderUrl),r=a.doc()?.docs?.length??0;if(r){g(`skipped \u2014 root folder already has ${r} doc(s); only fresh accounts are seeded`);return}let t=window.location.hostname.includes("gaios"),n=t?[]:await Ye();if(g(t?"gaios examples":"bundle init scripts:",n),!t&&!n.length){g("skipped \u2014 no static module bundles to ask");return}let s=await N("folder");if(!s){g("folder datatype never registered; giving up");return}let i=await Ke(s,l,d=>{d.title="Examples"});if(t){let{seedGaiosExamples:d}=await import("./gaiosExamples-YDNQB35L.js");await d(l,i)}for(let d of n)try{await(await import(d)).default?.(l,i),g("ran init script",d)}catch(c){g("init script unavailable or failed",d,c)}let u=i.doc()?.docs?.length??0;if(!u){g("no bundle contributed any documents");return}a.change(d=>{d.docs.unshift({name:"Examples",type:"folder",url:i.url})}),g(`seeded ${u} document(s) into Examples folder`,i.url)}var be="https://patchwork-tools.netlify.app/init.js",De="https://patchwork-base.netlify.app/init.js";function Ge(){return document.documentElement.getAttribute("data-examples")==="site"}async function Ye(){let e=Ge(),l=window.patchwork?.packages;if(!l?.urls)return e?[]:[De,be];await l.doneLoading;let o=Object.values(l.urls).filter(r=>typeof r=="string"&&!r.startsWith("automerge:")).map(r=>new URL("init.js",new URL(r,document.baseURI)).href);if(e)return[...new Set(o)];let a=o.length?[]:[De];return[...new Set([...o,...a,be])]}import{createEffect as Xe,createMemo as Je,createSignal as Qe,onCleanup as Ze}from"solid-js";function G(e){let[l,o]=Qe(0);return Xe(()=>{let a=e();if(!a)return;let r=()=>o(t=>t+1);a.on("change",r),Ze(()=>a.off("change",r))}),Je(()=>(l(),e()?.doc()))}var ot=_("<div class=frame-shell><aside class=frame-warning-banner>research grade software. do not share links. sharing a doc is sharing your account.</aside><div class=frame><patchwork-view component=patchwork-selected-doc-provider><patchwork-view component=patchwork-account-provider><patchwork-view component=patchwork-tool-storage-provider><patchwork-view component=patchwork-worker-provider>",!0,!1,!1),nt=_("<div style=display:contents>"),it=_("<div class=main-area>"),at=_("<div class=frame__popover-backdrop><div class=frame__popover role=dialog aria-modal=true><div class=frame__popover-toolbar><patchwork-view tool-id=doc-openwith></patchwork-view></div><div class=frame__popover-body><patchwork-view>",!0,!1,!1),lt=_('<button type=button class="frame__sidebar-toggle frame__left-toggle">'),st=_("<div class=threepane-sidebar><div class=threepane-sidebar__footer><footer class=threepane-account-bar><button type=button class=threepane-account-bar__button>Settings"),ct=_("<div class=frame__tray-dock>"),dt=_('<button type=button class="threepane-account-bar__button threepane-account-bar__avatar"title=Account aria-label=Account><patchwork-view tool-id=contact-avatar>',!0,!1,!1),ut=_("<button type=button class=threepane-account-bar__button>Packages"),mt=_('<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d="M9 3v18">'),X=(e,l)=>{let[o,a]=b(!1);return V(()=>{let r=l();if(!r)return;a(!1);let t=n=>{n.detail?.componentId===e&&a(!0)};r.addEventListener("patchwork:mounted",t),L(()=>r.removeEventListener("patchwork:mounted",t))}),o};function J(e,l){e.dispatchEvent(new CustomEvent("patchwork:open-document",{detail:l,bubbles:!0,composed:!0}))}function gt({handle:e,repo:l,...o}){me();let a=e.url,[r,t]=b(),n=X("patchwork-account-provider",r),[s,i]=b(),u=X("patchwork-tool-storage-provider",s),[d,c]=b(),f=X("patchwork-selected-doc-provider",d),p=pt(()=>f()&&n()&&u());return(()=>{var w=ot(),E=w.firstChild,Q=E.firstChild,A=E.nextSibling,h=A.firstChild,D=h.firstChild,$=D.firstChild,T=$.firstChild;return v(E,m(S,{get when(){return o.isolation},get children(){return[" ","isolation is highly experimental. if things are broken, switch back to wild west."]}}),null),C(c,h),h._$owner=k(),C(t,D),D.docUrl=a,D._$owner=k(),C(i,$),$.docUrl=a,$._$owner=k(),T._$owner=k(),v(T,m(S,{get when(){return p()},get children(){return m(wt,{handle:e,repo:l,get isolation(){return o.isolation}})}})),w})()}function wt(e){let l=B(()=>e.handle.url,{repo:e.repo});(async()=>{await ye(e.handle,e.repo),await $e(e.handle,e.repo)})().catch(y=>{console.error("frame: account bootstrap failed",y)});let o=G(l),a=e.handle.url,r=()=>o()?.tools?.threepane,t=B(()=>r(),{repo:e.repo}),n=G(t),s=()=>n()?.doctitle?.tools,i=()=>n()?.sidebar?.widgets??[],u=()=>n()?.tray??[],d=()=>o()?.rootFolderUrl,c=ie(),f=ae("left",{isCollapsed:c.isSidebarCollapsed,setCollapsed:c.setIsSidebarCollapsed,setWidth:c.setLeftSidebarWidth}),p,[w,E]=b(null),[Q,A]=b(null);ke(()=>{let y=ft(p,{type:"patchwork:selected-view"},x=>E(x));L(y)});let h=()=>w()?.url,D=()=>w()?.toolId??void 0,$=()=>oe(j.rightWidth,re),T=()=>ne(j.rightCollapsed),[Ce,Z]=b(),Ee=le(Ce,h),[ee,Te]=b(!1);return V(()=>{ee()||(e.isolation||!h()||Ee())&&Te(!0)}),(()=>{var y=nt(),x=p;return typeof x=="function"?C(x,y):p=y,v(y,m(_t,{accountDocUrl:a,sidebarState:c,sidebarResize:f,sidebarWidgets:i,traySlots:u,configHandle:t,rootFolderUrl:d,widgetsReady:ee,contactUrl:()=>o()?.contactUrl,moduleSettingsUrl:()=>o()?.moduleSettingsUrl,get isolation(){return e.isolation},onInterceptOpen:A,get children(){return m(S,{get when(){return h()},get fallback(){return(()=>{var O=it();return v(O,m(de,{viewKey:h,selectedDocUrl:h,toolId:D,ref:Z})),O})()},get children(){return m(S,{get when(){return e.isolation},get fallback(){return m(ue,{setMainDocElement:Z,selectedDocUrl:h,selectedToolId:D,doctitleSlots:s,get isLeftCollapsed(){return c.isSidebarCollapsed},initialRightWidth:$,initialRightCollapsed:T})},get children(){return m(fe,{get contactUrl(){return o()?.contactUrl},selectedDocUrl:h,selectedToolId:D,doctitleSlots:s,get isLeftCollapsed(){return c.isSidebarCollapsed},initialRightWidth:$,initialRightCollapsed:T})}})}})}}),null),v(y,m(S,{get when(){return Q()},children:O=>m(vt,{get view(){return O()},onClose:()=>A(null)})}),null),y})()}function vt(e){let[l,o]=b(e.view.toolId??void 0);V(()=>o(e.view.toolId??void 0));let a;return ke(()=>{let r=s=>{s.key==="Escape"&&e.onClose()};window.addEventListener("keydown",r),L(()=>window.removeEventListener("keydown",r));let t=a;if(!t)return;let n=s=>{let{url:i,toolId:u}=s.detail;i&&(s.stopPropagation(),o(u??void 0))};t.addEventListener("patchwork:open-document",n),L(()=>t.removeEventListener("patchwork:open-document",n))}),(()=>{var r=at(),t=r.firstChild,n=t.firstChild,s=n.firstChild,i=n.nextSibling,u=i.firstChild;r.$$click=()=>e.onClose(),t.$$click=c=>c.stopPropagation();var d=a;return typeof d=="function"?C(d,t):a=t,s._$owner=k(),u._$owner=k(),R(c=>{var f=e.view.url,p=e.view.url,w=l();return f!==c.e&&(s.docUrl=c.e=f),p!==c.t&&(u.docUrl=c.t=p),w!==c.a&&(u.toolId=c.a=w),c},{e:void 0,t:void 0,a:void 0}),r})()}function _t(e){let l=e.sidebarState.isSidebarCollapsed,o=()=>e.traySlots().length>0,a,r;return V(()=>{if(l())return;let t=a;if(!t)return;let n=r,s=i=>{let{url:u,toolId:d}=i.detail;if(e.isolation&&u&&n&&i.composedPath().includes(n)){i.stopPropagation(),e.onInterceptOpen?.({url:u,toolId:d??null});return}t.getBoundingClientRect().width<=window.innerWidth*.75||(e.sidebarState.setIsSidebarCollapsed(!0),window.dispatchEvent(new CustomEvent(te)))};t.addEventListener("patchwork:open-document",s),L(()=>t.removeEventListener("patchwork:open-document",s))}),[(()=>{var t=lt();return t.$$click=()=>e.sidebarState.setIsSidebarCollapsed(n=>!n),v(t,m(yt,{})),R(n=>{var s=l()?"Show sidebar":"Hide sidebar",i=l()?"Show sidebar":"Hide sidebar",u=!l();return s!==n.e&&Y(t,"title",n.e=s),i!==n.t&&Y(t,"aria-label",n.t=i),u!==n.a&&Y(t,"aria-pressed",n.a=u),n},{e:void 0,t:void 0,a:void 0}),t})(),m(se,{side:"left",isCollapsed:l,get width(){return e.sidebarState.leftSidebarWidth},get onMouseDown(){return e.sidebarResize.handleMouseDown},get onToggleClick(){return e.sidebarResize.handleToggleClick},get children(){var t=st(),n=t.firstChild,s=n.firstChild,i=s.firstChild,u=a;typeof u=="function"?C(u,t):a=t,v(t,m(he,{get widgets(){return e.sidebarWidgets},get configHandle(){return e.configHandle},get rootFolderUrl(){return e.rootFolderUrl},get ready(){return e.widgetsReady}}),n);var d=r;return typeof d=="function"?C(d,n):r=n,v(s,m(S,{get when(){return e.contactUrl()},children:c=>(()=>{var f=dt(),p=f.firstChild;return f.$$click=w=>J(w.currentTarget,{url:e.accountDocUrl,toolId:"account-picker"}),p._$owner=k(),R(()=>p.docUrl=c()),f})()}),i),v(s,m(S,{get when(){return e.moduleSettingsUrl()},children:c=>(()=>{var f=ut();return f.$$click=p=>J(p.currentTarget,{url:c(),toolId:"packages"}),f})()}),i),i.$$click=c=>J(c.currentTarget,{url:e.accountDocUrl,toolId:"frame-configurator"}),R(()=>t.classList.toggle("threepane-sidebar--has-tray",!!o())),t}}),m(S,{get when(){return o()},get children(){var t=ct();return v(t,m(ve,{get slots(){return e.traySlots}})),R(n=>{var s=!!l(),i=`${e.sidebarState.leftSidebarWidth()}px`;return s!==n.e&&t.classList.toggle("frame__tray-dock--collapsed",n.e=s),i!==n.t&&rt(t,"width",n.t=i),n},{e:void 0,t:void 0}),t}}),tt(()=>e.children)]}function yt(){return mt()}function Dr(e){return(l,o)=>ht(()=>m(gt,{handle:l,get repo(){return o.repo},isolation:e}),o)}et(["click"]);export{_t as FrameLayout,gt as PatchworkFrame,Dr as renderPatchworkFrame};
|
|
2
|
-
//# sourceMappingURL=PatchworkFrame-U2TVLGCZ.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/PatchworkFrame.tsx", "../src/components/SidebarWidgets.tsx", "../src/components/Tray.tsx", "../src/account/ensureThreepaneConfig.ts", "../src/account/loadDatatypeWhenReady.ts", "../src/account/seedExampleDocuments.ts", "../src/hooks/useHandleDoc.ts"],
|
|
4
|
-
"sourcesContent": ["import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { setStyleProperty as _$setStyleProperty } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { getOwner as _$getOwner } from \"solid-js/web\";\nimport { use as _$use } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=frame-shell><aside class=frame-warning-banner>research grade software. do not share links. sharing a doc is sharing your account.</aside><div class=frame><patchwork-view component=patchwork-selected-doc-provider><patchwork-view component=patchwork-account-provider><patchwork-view component=patchwork-tool-storage-provider><patchwork-view component=patchwork-worker-provider>`, true, false, false),\n _tmpl$2 = /*#__PURE__*/_$template(`<div style=display:contents>`),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=main-area>`),\n _tmpl$4 = /*#__PURE__*/_$template(`<div class=frame__popover-backdrop><div class=frame__popover role=dialog aria-modal=true><div class=frame__popover-toolbar><patchwork-view tool-id=doc-openwith></patchwork-view></div><div class=frame__popover-body><patchwork-view>`, true, false, false),\n _tmpl$5 = /*#__PURE__*/_$template(`<button type=button class=\"frame__sidebar-toggle frame__left-toggle\">`),\n _tmpl$6 = /*#__PURE__*/_$template(`<div class=threepane-sidebar><div class=threepane-sidebar__footer><footer class=threepane-account-bar><button type=button class=threepane-account-bar__button>Settings`),\n _tmpl$7 = /*#__PURE__*/_$template(`<div class=frame__tray-dock>`),\n _tmpl$8 = /*#__PURE__*/_$template(`<button type=button class=\"threepane-account-bar__button threepane-account-bar__avatar\"title=Account aria-label=Account><patchwork-view tool-id=contact-avatar>`, true, false, false),\n _tmpl$9 = /*#__PURE__*/_$template(`<button type=button class=threepane-account-bar__button>Packages`),\n _tmpl$0 = /*#__PURE__*/_$template(`<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox=\"0 0 24 24\"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d=\"M9 3v18\">`);\nimport \"@inkandswitch/patchwork-elements\";\nimport { useDocHandle } from \"solid-automerge\";\nimport { subscribe } from \"@inkandswitch/patchwork-providers\";\nimport { useSidebarState, useSidebarResize, useMainDocMounted, SIDEBAR_KEYS, COLLAPSE_CONTEXT_SIDEBAR_EVENT, getStoredNumber, getStoredBoolean, DEFAULT_SIDEBAR_WIDTH } from \"./hooks\";\nimport { Sidebar } from \"./components/Sidebar\";\nimport { SidebarWidgets } from \"./components/SidebarWidgets\";\nimport { DocumentAreaRoot } from \"./components/DocumentAreaRoot\";\nimport { IsolatedDocumentArea } from \"./components/IsolatedDocumentArea\";\nimport { MainDocumentView } from \"./components/MainDocumentView\";\nimport { Tray } from \"./components/Tray\";\nimport { createEffect, createMemo, createSignal, onCleanup, onMount, Show } from \"solid-js\";\nimport { render } from \"solid-js/web\";\nimport { ensureThreepaneConfig } from \"./account/ensureThreepaneConfig\";\nimport { seedExampleDocuments } from \"./account/seedExampleDocuments\";\nimport { ensureFrameStyles } from \"./ensureFrameStyles\";\nimport { useHandleDoc } from \"./hooks/useHandleDoc\";\nconst useFrameProviderReady = (componentId, element) => {\n const [isReady, setReady] = createSignal(false);\n createEffect(() => {\n const el = element();\n if (!el) return;\n setReady(false);\n const onMounted = event => {\n const detail = event.detail;\n if (detail?.componentId !== componentId) return;\n setReady(true);\n };\n el.addEventListener(\"patchwork:mounted\", onMounted);\n onCleanup(() => el.removeEventListener(\"patchwork:mounted\", onMounted));\n });\n return isReady;\n};\nfunction dispatchOpen(el, detail) {\n el.dispatchEvent(new CustomEvent(\"patchwork:open-document\", {\n detail,\n bubbles: true,\n composed: true\n }));\n}\nexport function PatchworkFrame({\n handle,\n repo,\n ...props\n}) {\n ensureFrameStyles();\n const accountDocUrl = handle.url;\n const [accountProviderElement, setAccountProviderElement] = createSignal();\n const isAccountProviderReady = useFrameProviderReady(\"patchwork-account-provider\", accountProviderElement);\n const [toolStorageProviderElement, setToolStorageProviderElement] = createSignal();\n const isToolStorageProviderReady = useFrameProviderReady(\"patchwork-tool-storage-provider\", toolStorageProviderElement);\n const [selectedDocProviderElement, setSelectedDocProviderElement] = createSignal();\n const isSelectedDocProviderReady = useFrameProviderReady(\"patchwork-selected-doc-provider\", selectedDocProviderElement);\n const areProvidersReady = createMemo(() => isSelectedDocProviderReady() && isAccountProviderReady() && isToolStorageProviderReady());\n return (() => {\n var _el$ = _tmpl$(),\n _el$2 = _el$.firstChild,\n _el$3 = _el$2.firstChild,\n _el$4 = _el$2.nextSibling,\n _el$5 = _el$4.firstChild,\n _el$6 = _el$5.firstChild,\n _el$7 = _el$6.firstChild,\n _el$8 = _el$7.firstChild;\n _$insert(_el$2, _$createComponent(Show, {\n get when() {\n return props.isolation;\n },\n get children() {\n return [\" \", \"isolation is highly experimental. if things are broken, switch back to wild west.\"];\n }\n }), null);\n _$use(setSelectedDocProviderElement, _el$5);\n _el$5._$owner = _$getOwner();\n _$use(setAccountProviderElement, _el$6);\n _el$6.docUrl = accountDocUrl;\n _el$6._$owner = _$getOwner();\n _$use(setToolStorageProviderElement, _el$7);\n _el$7.docUrl = accountDocUrl;\n _el$7._$owner = _$getOwner();\n _el$8._$owner = _$getOwner();\n _$insert(_el$8, _$createComponent(Show, {\n get when() {\n return areProvidersReady();\n },\n get children() {\n return _$createComponent(PatchworkFrameInner, {\n handle: handle,\n repo: repo,\n get isolation() {\n return props.isolation;\n }\n });\n }\n }));\n return _el$;\n })();\n}\nfunction PatchworkFrameInner(props) {\n const accountDocHandle = useDocHandle(() => props.handle.url, {\n repo: props.repo\n });\n void (async () => {\n await ensureThreepaneConfig(props.handle, props.repo);\n await seedExampleDocuments(props.handle, props.repo);\n })().catch(err => {\n console.error(\"frame: account bootstrap failed\", err);\n });\n const accountDoc = useHandleDoc(accountDocHandle);\n const accountDocUrl = props.handle.url;\n const threepaneUrl = () => accountDoc()?.tools?.[\"threepane\"];\n const threepaneConfigHandle = useDocHandle(() => threepaneUrl(), {\n repo: props.repo\n });\n const threepaneConfig = useHandleDoc(threepaneConfigHandle);\n const doctitleSlots = () => threepaneConfig()?.doctitle?.tools;\n const sidebarWidgets = () => threepaneConfig()?.sidebar?.widgets ?? [];\n const traySlots = () => threepaneConfig()?.tray ?? [];\n const rootFolderUrl = () => accountDoc()?.rootFolderUrl;\n const sidebarState = useSidebarState();\n const sidebarResize = useSidebarResize(\"left\", {\n isCollapsed: sidebarState.isSidebarCollapsed,\n setCollapsed: sidebarState.setIsSidebarCollapsed,\n setWidth: sidebarState.setLeftSidebarWidth\n });\n let element;\n const [selectedView, setSelectedView] = createSignal(null);\n const [popoverView, setPopoverView] = createSignal(null);\n onMount(() => {\n const unsubscribeSelectedView = subscribe(element, {\n type: \"patchwork:selected-view\"\n }, view => setSelectedView(view));\n onCleanup(unsubscribeSelectedView);\n });\n const selectedDocUrl = () => selectedView()?.url;\n const selectedToolId = () => selectedView()?.toolId ?? void 0;\n const initialRightWidth = () => getStoredNumber(SIDEBAR_KEYS.rightWidth, DEFAULT_SIDEBAR_WIDTH);\n const initialRightCollapsed = () => getStoredBoolean(SIDEBAR_KEYS.rightCollapsed);\n const [mainDocElement, setMainDocElement] = createSignal();\n const isMainDocMounted = useMainDocMounted(mainDocElement, selectedDocUrl);\n const [widgetsReady, setWidgetsReady] = createSignal(false);\n createEffect(() => {\n if (widgetsReady()) return;\n if (props.isolation || !selectedDocUrl() || isMainDocMounted()) setWidgetsReady(true);\n });\n return (() => {\n var _el$9 = _tmpl$2();\n var _ref$ = element;\n typeof _ref$ === \"function\" ? _$use(_ref$, _el$9) : element = _el$9;\n _$insert(_el$9, _$createComponent(FrameLayout, {\n accountDocUrl: accountDocUrl,\n sidebarState: sidebarState,\n sidebarResize: sidebarResize,\n sidebarWidgets: sidebarWidgets,\n traySlots: traySlots,\n configHandle: threepaneConfigHandle,\n rootFolderUrl: rootFolderUrl,\n widgetsReady: widgetsReady,\n contactUrl: () => accountDoc()?.contactUrl,\n moduleSettingsUrl: () => accountDoc()?.moduleSettingsUrl,\n get isolation() {\n return props.isolation;\n },\n onInterceptOpen: setPopoverView,\n get children() {\n return _$createComponent(Show, {\n get when() {\n return selectedDocUrl();\n },\n get fallback() {\n return (() => {\n var _el$0 = _tmpl$3();\n _$insert(_el$0, _$createComponent(MainDocumentView, {\n viewKey: selectedDocUrl,\n selectedDocUrl: selectedDocUrl,\n toolId: selectedToolId,\n ref: setMainDocElement\n }));\n return _el$0;\n })();\n },\n get children() {\n return _$createComponent(Show, {\n get when() {\n return props.isolation;\n },\n get fallback() {\n return _$createComponent(DocumentAreaRoot, {\n setMainDocElement: setMainDocElement,\n selectedDocUrl: selectedDocUrl,\n selectedToolId: selectedToolId,\n doctitleSlots: doctitleSlots,\n get isLeftCollapsed() {\n return sidebarState.isSidebarCollapsed;\n },\n initialRightWidth: initialRightWidth,\n initialRightCollapsed: initialRightCollapsed\n });\n },\n get children() {\n return _$createComponent(IsolatedDocumentArea, {\n get contactUrl() {\n return accountDoc()?.contactUrl;\n },\n selectedDocUrl: selectedDocUrl,\n selectedToolId: selectedToolId,\n doctitleSlots: doctitleSlots,\n get isLeftCollapsed() {\n return sidebarState.isSidebarCollapsed;\n },\n initialRightWidth: initialRightWidth,\n initialRightCollapsed: initialRightCollapsed\n });\n }\n });\n }\n });\n }\n }), null);\n _$insert(_el$9, _$createComponent(Show, {\n get when() {\n return popoverView();\n },\n children: view => _$createComponent(FramePopover, {\n get view() {\n return view();\n },\n onClose: () => setPopoverView(null)\n })\n }), null);\n return _el$9;\n })();\n}\nfunction FramePopover(props) {\n const [toolId, setToolId] = createSignal(props.view.toolId ?? void 0);\n createEffect(() => setToolId(props.view.toolId ?? void 0));\n let popoverEl;\n onMount(() => {\n const onKey = e => {\n if (e.key === \"Escape\") props.onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n onCleanup(() => window.removeEventListener(\"keydown\", onKey));\n const el = popoverEl;\n if (!el) return;\n const onOpen = event => {\n const {\n url,\n toolId: nextToolId\n } = event.detail;\n if (!url) return;\n event.stopPropagation();\n setToolId(nextToolId ?? void 0);\n };\n el.addEventListener(\"patchwork:open-document\", onOpen);\n onCleanup(() => el.removeEventListener(\"patchwork:open-document\", onOpen));\n });\n return (() => {\n var _el$1 = _tmpl$4(),\n _el$10 = _el$1.firstChild,\n _el$11 = _el$10.firstChild,\n _el$12 = _el$11.firstChild,\n _el$13 = _el$11.nextSibling,\n _el$14 = _el$13.firstChild;\n _el$1.$$click = () => props.onClose();\n _el$10.$$click = e => e.stopPropagation();\n var _ref$2 = popoverEl;\n typeof _ref$2 === \"function\" ? _$use(_ref$2, _el$10) : popoverEl = _el$10;\n _el$12._$owner = _$getOwner();\n _el$14._$owner = _$getOwner();\n _$effect(_p$ => {\n var _v$ = props.view.url,\n _v$2 = props.view.url,\n _v$3 = toolId();\n _v$ !== _p$.e && (_el$12.docUrl = _p$.e = _v$);\n _v$2 !== _p$.t && (_el$14.docUrl = _p$.t = _v$2);\n _v$3 !== _p$.a && (_el$14.toolId = _p$.a = _v$3);\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined\n });\n return _el$1;\n })();\n}\nexport function FrameLayout(props) {\n const isCollapsed = props.sidebarState.isSidebarCollapsed;\n const hasTray = () => props.traySlots().length > 0;\n let sidebarContentEl;\n let footerEl;\n createEffect(() => {\n if (isCollapsed()) return;\n const el = sidebarContentEl;\n if (!el) return;\n const footer = footerEl;\n const onOpen = event => {\n const {\n url,\n toolId\n } = event.detail;\n if (props.isolation && url && footer && event.composedPath().includes(footer)) {\n event.stopPropagation();\n props.onInterceptOpen?.({\n url,\n toolId: toolId ?? null\n });\n return;\n }\n if (el.getBoundingClientRect().width <= window.innerWidth * 0.75) return;\n props.sidebarState.setIsSidebarCollapsed(true);\n window.dispatchEvent(new CustomEvent(COLLAPSE_CONTEXT_SIDEBAR_EVENT));\n };\n el.addEventListener(\"patchwork:open-document\", onOpen);\n onCleanup(() => el.removeEventListener(\"patchwork:open-document\", onOpen));\n });\n return [(() => {\n var _el$15 = _tmpl$5();\n _el$15.$$click = () => props.sidebarState.setIsSidebarCollapsed(v => !v);\n _$insert(_el$15, _$createComponent(PanelLeftIcon, {}));\n _$effect(_p$ => {\n var _v$4 = isCollapsed() ? \"Show sidebar\" : \"Hide sidebar\",\n _v$5 = isCollapsed() ? \"Show sidebar\" : \"Hide sidebar\",\n _v$6 = !isCollapsed();\n _v$4 !== _p$.e && _$setAttribute(_el$15, \"title\", _p$.e = _v$4);\n _v$5 !== _p$.t && _$setAttribute(_el$15, \"aria-label\", _p$.t = _v$5);\n _v$6 !== _p$.a && _$setAttribute(_el$15, \"aria-pressed\", _p$.a = _v$6);\n return _p$;\n }, {\n e: undefined,\n t: undefined,\n a: undefined\n });\n return _el$15;\n })(), _$createComponent(Sidebar, {\n side: \"left\",\n isCollapsed: isCollapsed,\n get width() {\n return props.sidebarState.leftSidebarWidth;\n },\n get onMouseDown() {\n return props.sidebarResize.handleMouseDown;\n },\n get onToggleClick() {\n return props.sidebarResize.handleToggleClick;\n },\n get children() {\n var _el$16 = _tmpl$6(),\n _el$17 = _el$16.firstChild,\n _el$18 = _el$17.firstChild,\n _el$19 = _el$18.firstChild;\n var _ref$3 = sidebarContentEl;\n typeof _ref$3 === \"function\" ? _$use(_ref$3, _el$16) : sidebarContentEl = _el$16;\n _$insert(_el$16, _$createComponent(SidebarWidgets, {\n get widgets() {\n return props.sidebarWidgets;\n },\n get configHandle() {\n return props.configHandle;\n },\n get rootFolderUrl() {\n return props.rootFolderUrl;\n },\n get ready() {\n return props.widgetsReady;\n }\n }), _el$17);\n var _ref$4 = footerEl;\n typeof _ref$4 === \"function\" ? _$use(_ref$4, _el$17) : footerEl = _el$17;\n _$insert(_el$18, _$createComponent(Show, {\n get when() {\n return props.contactUrl();\n },\n children: contactUrl => (() => {\n var _el$21 = _tmpl$8(),\n _el$22 = _el$21.firstChild;\n _el$21.$$click = e => dispatchOpen(e.currentTarget, {\n url: props.accountDocUrl,\n toolId: \"account-picker\"\n });\n _el$22._$owner = _$getOwner();\n _$effect(() => _el$22.docUrl = contactUrl());\n return _el$21;\n })()\n }), _el$19);\n _$insert(_el$18, _$createComponent(Show, {\n get when() {\n return props.moduleSettingsUrl();\n },\n children: moduleSettingsUrl => (() => {\n var _el$23 = _tmpl$9();\n _el$23.$$click = e => dispatchOpen(e.currentTarget, {\n url: moduleSettingsUrl(),\n toolId: \"packages\"\n });\n return _el$23;\n })()\n }), _el$19);\n _el$19.$$click = e => dispatchOpen(e.currentTarget, {\n url: props.accountDocUrl,\n toolId: \"frame-configurator\"\n });\n _$effect(() => _el$16.classList.toggle(\"threepane-sidebar--has-tray\", !!hasTray()));\n return _el$16;\n }\n }), _$createComponent(Show, {\n get when() {\n return hasTray();\n },\n get children() {\n var _el$20 = _tmpl$7();\n _$insert(_el$20, _$createComponent(Tray, {\n get slots() {\n return props.traySlots;\n }\n }));\n _$effect(_p$ => {\n var _v$7 = !!isCollapsed(),\n _v$8 = `${props.sidebarState.leftSidebarWidth()}px`;\n _v$7 !== _p$.e && _el$20.classList.toggle(\"frame__tray-dock--collapsed\", _p$.e = _v$7);\n _v$8 !== _p$.t && _$setStyleProperty(_el$20, \"width\", _p$.t = _v$8);\n return _p$;\n }, {\n e: undefined,\n t: undefined\n });\n return _el$20;\n }\n }), _$memo(() => props.children)];\n}\nfunction PanelLeftIcon() {\n return _tmpl$0();\n}\nexport function renderPatchworkFrame(isolation) {\n return (handle, element) => {\n return render(() => _$createComponent(PatchworkFrame, {\n handle: handle,\n get repo() {\n return element.repo;\n },\n isolation: isolation\n }), element);\n };\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { delegateEvents as _$delegateEvents } from \"solid-js/web\";\nimport { memo as _$memo } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=threepane-widgets>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=threepane-widgets__empty><button type=button class=threepane-widgets__add>\uFF0B Add document list`),\n _tmpl$3 = /*#__PURE__*/_$template(`<div class=threepane-widget>`);\nimport { For, Show } from \"solid-js\";\nimport { SlotView } from \"./SlotView\";\nimport { DOCUMENT_LIST_TOOL } from \"../datatypes\";\nexport function SidebarWidgets(props) {\n const addDocumentList = () => {\n const root = props.rootFolderUrl();\n const handle = props.configHandle();\n if (!root || !handle) return;\n handle.change(doc => {\n doc.sidebar.widgets.push([DOCUMENT_LIST_TOOL, root]);\n });\n };\n return (() => {\n var _el$ = _tmpl$();\n _$insert(_el$, _$createComponent(Show, {\n get when() {\n return props.ready();\n },\n get children() {\n return _$createComponent(Show, {\n get when() {\n return props.widgets().length;\n },\n get fallback() {\n return (// While the config/root folder are still loading we can't add a\n // widget yet \u2014 show nothing rather than a disabled button.\n _$createComponent(Show, {\n get when() {\n return _$memo(() => !!props.rootFolderUrl())() && props.configHandle();\n },\n get children() {\n var _el$2 = _tmpl$2(),\n _el$3 = _el$2.firstChild;\n _el$3.$$click = addDocumentList;\n return _el$2;\n }\n })\n );\n },\n get children() {\n return _$createComponent(For, {\n get each() {\n return props.widgets();\n },\n children: widget => (() => {\n var _el$4 = _tmpl$3();\n _$insert(_el$4, _$createComponent(SlotView, {\n slot: widget\n }));\n return _el$4;\n })()\n });\n }\n });\n }\n }));\n return _el$;\n })();\n}\n_$delegateEvents([\"click\"]);", "import { template as _$template } from \"solid-js/web\";\nimport { setAttribute as _$setAttribute } from \"solid-js/web\";\nimport { effect as _$effect } from \"solid-js/web\";\nimport { insert as _$insert } from \"solid-js/web\";\nimport { createComponent as _$createComponent } from \"solid-js/web\";\nvar _tmpl$ = /*#__PURE__*/_$template(`<div class=frame-tray>`),\n _tmpl$2 = /*#__PURE__*/_$template(`<div class=frame-tray__item>`);\nimport { For, Show } from \"solid-js\";\nimport { SlotView, slotId, uniqueSlots } from \"./SlotView\";\nexport function Tray(props) {\n return _$createComponent(Show, {\n get when() {\n return props.slots().length;\n },\n get children() {\n var _el$ = _tmpl$();\n _$insert(_el$, _$createComponent(For, {\n get each() {\n return uniqueSlots(props.slots());\n },\n children: slot => (() => {\n var _el$2 = _tmpl$2();\n _$insert(_el$2, _$createComponent(SlotView, {\n slot: slot\n }));\n _$effect(() => _$setAttribute(_el$2, \"data-tray-id\", slotId(slot)));\n return _el$2;\n })()\n }));\n return _el$;\n }\n });\n}", "import type { AutomergeUrl, DocHandle, Repo } from \"@automerge/automerge-repo/slim\";\nimport { createDocOfDatatype2 } from \"@inkandswitch/patchwork-plugins\";\nimport type { AccountDoc, ThreepaneConfigDoc, ToolRef, ToolSlot } from \"../types\";\nimport {\n DEFAULT_DOCTITLE_TOOLS,\n DEFAULT_TRAY_TOOLS,\n DOCUMENT_LIST_TOOL,\n THREEPANE_CONFIG_VERSION,\n} from \"../datatypes\";\nimport { loadDatatypeWhenReady } from \"./loadDatatypeWhenReady\";\nimport { slotId, uniqueSlots } from \"../components/SlotView\";\n\n// Title + spacer are intrinsic to the frame's top bar, never configured tools.\nconst INTRINSIC_DOCTITLE_TOOLS = new Set([\"document-title\", \"spacer\"]);\n\n/** The default sidebar widgets for a fresh (or empty) account. */\nfunction defaultSidebarWidgets(rootFolderUrl?: AutomergeUrl): ToolRef[] {\n return rootFolderUrl ? [[DOCUMENT_LIST_TOOL, rootFolderUrl]] : [];\n}\n\n/**\n * Bring a config doc made before versioning up to THREEPANE_CONFIG_VERSION:\n * fill in the default document list, tray and doctitle tools it's missing, and\n * drop duplicate tray slots. Runs once per doc. After that the doc is the\n * person's to edit, and anything they remove stays removed.\n */\nexport function migrateThreepaneConfig(\n doc: ThreepaneConfigDoc,\n rootFolderUrl?: AutomergeUrl\n) {\n if ((doc.version ?? 0) >= THREEPANE_CONFIG_VERSION) return;\n\n if (!doc.sidebar) doc.sidebar = { widgets: [] };\n if (rootFolderUrl && !doc.sidebar.widgets?.length) {\n doc.sidebar.widgets = defaultSidebarWidgets(rootFolderUrl);\n }\n\n if (!doc.tray) {\n doc.tray = DEFAULT_TRAY_TOOLS.slice();\n } else {\n // Append default tray tools the saved tray is missing, like\n // llm-config-tray. slotId compares across the string and tuple forms.\n const unique = uniqueSlots(doc.tray);\n if (unique.length !== doc.tray.length) doc.tray = unique;\n const present = new Set(doc.tray.map((s) => slotId(s)));\n for (const id of DEFAULT_TRAY_TOOLS) {\n if (!present.has(id)) {\n doc.tray.push(id);\n present.add(id);\n }\n }\n }\n\n // A doctitle lane that ended up empty (nothing to migrate from the legacy\n // field) gets the defaults rather than a bare top bar.\n if (!doc.doctitle?.tools?.length) {\n doc.doctitle = { ...doc.doctitle, tools: DEFAULT_DOCTITLE_TOOLS.slice() };\n }\n\n // Can't seed the document list until the account has a root folder, so leave\n // the migration pending and try again on the next mount.\n if (!doc.sidebar.widgets?.length && !rootFolderUrl) return;\n\n doc.version = THREEPANE_CONFIG_VERSION;\n}\n\n/**\n * Lazily create the threepane layout config doc and point `account.tools.threepane`\n * at it, migrating the legacy `account.documentToolbarToolIds` into its\n * `doctitle` lane and seeding the sidebar with a document list pinned to the\n * account's root folder.\n *\n * Defaults are written only when the config doc is created, or once when an\n * older doc is migrated (see `migrateThreepaneConfig`), never on every mount.\n *\n * Non-destructive: the old `documentToolbarToolIds` / `accountSidebarToolId`\n * fields are left untouched so older builds keep working. Run the (separate,\n * opt-in) cleanupLegacyAccountFields script to remove them later.\n */\nexport async function ensureThreepaneConfig(\n accountHandle: DocHandle<AccountDoc>,\n repo: Repo\n) {\n const rootFolderUrl = accountHandle.doc()?.rootFolderUrl;\n const existingConfigUrl = accountHandle.doc()?.tools?.[\"threepane\"];\n\n if (existingConfigUrl) {\n const configHandle = await repo.find<ThreepaneConfigDoc>(existingConfigUrl);\n if ((configHandle.doc()?.version ?? 0) >= THREEPANE_CONFIG_VERSION) return;\n configHandle.change((doc) => migrateThreepaneConfig(doc, rootFolderUrl));\n return;\n }\n\n const datatype = await loadDatatypeWhenReady<ThreepaneConfigDoc>(\n \"threepane:config\"\n );\n if (!datatype) {\n console.warn(\"frame: threepane:config datatype never registered\");\n return;\n }\n\n // Re-check after the await in case another tab migrated concurrently.\n if (accountHandle.doc()?.tools?.[\"threepane\"]) return;\n\n const account = accountHandle.doc();\n\n // doctitle tools migrate as bare ids: the frame always points them at the\n // selected main-view doc, so a slot tuple's docid would be ignored \u2014 keep\n // them as plain strings.\n const doctitleTools: ToolSlot[] = (account?.documentToolbarToolIds ?? [])\n .filter((id) => !INTRINSIC_DOCTITLE_TOOLS.has(id));\n\n const configHandle = await createDocOfDatatype2<ThreepaneConfigDoc>(\n datatype,\n repo\n );\n configHandle.change((doc) => {\n if (doctitleTools.length) doc.doctitle.tools = doctitleTools;\n doc.sidebar.widgets = defaultSidebarWidgets(account?.rootFolderUrl);\n if (!doc.tray) doc.tray = DEFAULT_TRAY_TOOLS.slice();\n // No root folder yet means no document list yet: leave the doc unversioned\n // so the next mount's migration seeds it.\n if (account?.rootFolderUrl) doc.version = THREEPANE_CONFIG_VERSION;\n else delete doc.version;\n });\n\n accountHandle.change((acc) => {\n if (!acc.tools) acc.tools = {};\n if (!acc.tools[\"threepane\"]) acc.tools[\"threepane\"] = configHandle.url;\n });\n}\n", "import {\n getRegistry,\n type DatatypeDescription,\n type LoadedDatatype,\n} from \"@inkandswitch/patchwork-plugins\";\n\nexport function loadDatatypeWhenReady<D>(\n id: string\n): Promise<LoadedDatatype<D>> {\n return getRegistry<DatatypeDescription>(\n \"patchwork:datatype\"\n ).loadWhenReady(id) as Promise<LoadedDatatype<D>>;\n}\n", "import debug from \"debug\";\nimport type { DocHandle, Repo } from \"@automerge/automerge-repo/slim\";\nimport { createDocOfDatatype2 } from \"@inkandswitch/patchwork-plugins\";\nimport type { FolderDoc } from \"@inkandswitch/patchwork-filesystem\";\nimport type { AccountDoc } from \"../types\";\nimport { loadDatatypeWhenReady } from \"./loadDatatypeWhenReady\";\n\nconst log = debug(\"patchwork:threepane:examples\");\n\n/**\n * Seed a fresh account with example documents by running each static module\n * bundle's generated `init.js` (emitted by that repo's scripts/bundle.mjs next\n * to its modules.json). Every init script receives the same Examples folder\n * handle, so multiple bundles merge their examples into one folder.\n *\n * Runs at most once per account: the account doc's `exampleDocsSeededAt`\n * marker is claimed *before* seeding (a race between two tabs can at worst\n * skip the examples, never duplicate them), and a deleted Examples folder is\n * never recreated. Accounts that already have documents get the marker but no\n * examples \u2014 only truly fresh accounts are seeded.\n */\nexport async function seedExampleDocuments(\n accountHandle: DocHandle<AccountDoc>,\n repo: Repo\n) {\n const account = accountHandle.doc();\n if (!account?.rootFolderUrl) {\n log(\"skipped \u2014 account has no rootFolderUrl\");\n return;\n }\n if (account.exampleDocsSeededAt) {\n log(\n \"skipped \u2014 already ran for this account at\",\n new Date(account.exampleDocsSeededAt).toISOString()\n );\n return;\n }\n\n log(\"claiming marker on account\", accountHandle.url);\n accountHandle.change((doc) => {\n if (!doc.exampleDocsSeededAt) doc.exampleDocsSeededAt = Date.now();\n });\n\n const rootFolder = await repo.find<FolderDoc>(account.rootFolderUrl);\n const existingDocs = rootFolder.doc()?.docs?.length ?? 0;\n if (existingDocs) {\n log(\n `skipped \u2014 root folder already has ${existingDocs} doc(s); only fresh accounts are seeded`\n );\n return;\n }\n\n const gaios = window.location.hostname.includes(\"gaios\");\n const initUrls = gaios ? [] : await bundleInitScriptUrls();\n log(gaios ? \"gaios examples\" : \"bundle init scripts:\", initUrls);\n if (!gaios && !initUrls.length) {\n log(\"skipped \u2014 no static module bundles to ask\");\n return;\n }\n\n const folderDatatype = await loadDatatypeWhenReady<FolderDoc>(\"folder\");\n if (!folderDatatype) {\n log(\"folder datatype never registered; giving up\");\n return;\n }\n const folder = await createDocOfDatatype2<FolderDoc>(\n folderDatatype,\n repo,\n (doc) => {\n doc.title = \"Examples\";\n }\n );\n\n if (gaios) {\n const { seedGaiosExamples } = await import(\"./gaiosExamples\");\n await seedGaiosExamples(repo, folder);\n }\n\n for (const url of initUrls) {\n try {\n const mod = await import(/* @vite-ignore */ url);\n await mod.default?.(repo, folder);\n log(\"ran init script\", url);\n } catch (err) {\n // A bundle that ships no init script 404s here \u2014 normal, not an error.\n log(\"init script unavailable or failed\", url, err);\n }\n }\n\n const seeded = folder.doc()?.docs?.length ?? 0;\n if (!seeded) {\n // Don't leave an empty Examples folder if no bundle contributed anything.\n log(\"no bundle contributed any documents\");\n return;\n }\n\n rootFolder.change((doc) => {\n doc.docs.unshift({ name: \"Examples\", type: \"folder\", url: folder.url });\n });\n log(`seeded ${seeded} document(s) into Examples folder`, folder.url);\n}\n\ntype ModuleWatcherLike = {\n urls?: Record<string, string>;\n doneLoading?: Promise<void>;\n};\n\n/**\n * The patchwork-tools bundle isn't in every site's default module sources\n * (some boot from an automerge module-settings doc, which has no init.js),\n * but its examples should seed everywhere \u2014 so it's always consulted, unless\n * the site asks for only its own examples (see siteExamplesOnly).\n */\nconst TOOLS_BUNDLE_INIT_URL = \"https://patchwork-tools.netlify.app/init.js\";\n\n/**\n * Fallback for shells with no static manifest at all (automerge-doc module\n * sources only): the deployed patchwork-base bundle. Not consulted when any\n * static manifest is configured, because that manifest is usually a copy of\n * this very bundle (e.g. a localhost dev serve) and URL-dedupe can't tell \u2014\n * always adding it would seed base's examples twice.\n */\nconst BASE_BUNDLE_INIT_URL = \"https://patchwork-base.netlify.app/init.js\";\n\n/**\n * A site that wants only its own examples says so on its root element \u2014\n * `<html data-examples=\"site\">` \u2014 and the hardcoded bundles above are left\n * out: just the init.js next to each of its own static manifests runs.\n */\nfunction siteExamplesOnly() {\n return document.documentElement.getAttribute(\"data-examples\") === \"site\";\n}\n\n/**\n * The `init.js` URL next to every static (http) module manifest the host is\n * watching, plus the hardcoded bundles above (unless the site opts out of\n * them). Automerge module-settings docs have no init script. Waits for the\n * watcher's initial load so the bundles' plugins are registered before any\n * example runs.\n */\nasync function bundleInitScriptUrls(): Promise<string[]> {\n const siteOnly = siteExamplesOnly();\n const watcher = (\n window as { patchwork?: { packages?: ModuleWatcherLike } }\n ).patchwork?.packages;\n if (!watcher?.urls) {\n return siteOnly ? [] : [BASE_BUNDLE_INIT_URL, TOOLS_BUNDLE_INIT_URL];\n }\n await watcher.doneLoading;\n const fromManifests = Object.values(watcher.urls)\n .filter((url) => typeof url === \"string\" && !url.startsWith(\"automerge:\"))\n .map((url) => new URL(\"init.js\", new URL(url, document.baseURI)).href);\n if (siteOnly) return [...new Set(fromManifests)];\n const base = fromManifests.length ? [] : [BASE_BUNDLE_INIT_URL];\n return [...new Set([...fromManifests, ...base, TOOLS_BUNDLE_INIT_URL])];\n}\n", "import type { DocHandle } from \"@automerge/automerge-repo/slim\";\nimport {\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n type Accessor,\n} from \"solid-js\";\n\n/**\n * The current doc of a handle, recomputed on every change. Reads through a\n * version counter instead of useDocument, because its store proxying conflicts\n * with Automerge array splices.\n */\nexport function useHandleDoc<T>(\n handle: Accessor<DocHandle<T> | undefined>\n): Accessor<T | undefined> {\n const [version, setVersion] = createSignal(0);\n createEffect(() => {\n const h = handle();\n if (!h) return;\n const onChange = () => setVersion((v) => v + 1);\n h.on(\"change\", onChange);\n onCleanup(() => h.off(\"change\", onChange));\n });\n return createMemo(() => {\n version();\n return handle()?.doc();\n });\n}\n"],
|
|
5
|
-
"mappings": "mRAAA,OAAS,YAAYA,MAAkB,eACvC,OAAS,kBAAkBC,OAAwB,eACnD,OAAS,QAAQC,OAAc,eAC/B,OAAS,oBAAoBC,OAA0B,eACvD,OAAS,gBAAgBC,MAAsB,eAC/C,OAAS,UAAUC,MAAgB,eACnC,OAAS,YAAYC,MAAkB,eACvC,OAAS,OAAOC,MAAa,eAC7B,OAAS,UAAUC,MAAgB,eACnC,OAAS,mBAAmBC,MAAyB,eAWrD,MAAO,mCAEP,OAAS,aAAAC,OAAiB,oCCtB1B,OAAS,YAAYC,MAAkB,eACvC,OAAS,kBAAkBC,OAAwB,eACnD,OAAS,QAAQC,OAAc,eAC/B,OAAS,UAAUC,OAAgB,eACnC,OAAS,mBAAmBC,MAAyB,eAIrD,OAAS,OAAAC,GAAK,QAAAC,MAAY,WAH1B,IAAIC,GAAsBC,EAAW,+BAA+B,EAClEC,GAAuBD,EAAW,+GAA0G,EAC5IE,GAAuBF,EAAW,8BAA8B,EAI3D,SAASG,GAAeC,EAAO,CACpC,IAAMC,EAAkB,IAAM,CAC5B,IAAMC,EAAOF,EAAM,cAAc,EAC3BG,EAASH,EAAM,aAAa,EAC9B,CAACE,GAAQ,CAACC,GACdA,EAAO,OAAOC,GAAO,CACnBA,EAAI,QAAQ,QAAQ,KAAK,CAACC,EA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IAAI,UAAW,CACb,IAAIyB,EAAS9I,GAAQ,EACrB,OAAA0C,EAASoG,EAAQnG,EAAkBoG,GAAM,CACvC,IAAI,OAAQ,CACV,OAAO3H,EAAM,SACf,CACF,CAAC,CAAC,EACF2F,EAASC,GAAO,CACd,IAAIgC,EAAO,CAAC,CAAC5B,EAAY,EACvB6B,EAAO,GAAG7H,EAAM,aAAa,iBAAiB,CAAC,KACjD,OAAA4H,IAAShC,EAAI,GAAK8B,EAAO,UAAU,OAAO,8BAA+B9B,EAAI,EAAIgC,CAAI,EACrFC,IAASjC,EAAI,GAAKkC,GAAmBJ,EAAQ,QAAS9B,EAAI,EAAIiC,CAAI,EAC3DjC,CACT,EAAG,CACD,EAAG,OACH,EAAG,MACL,CAAC,EACM8B,CACT,CACF,CAAC,EAAGK,GAAO,IAAM/H,EAAM,QAAQ,CAAC,CAClC,CACA,SAASwG,IAAgB,CACvB,OAAOzH,GAAQ,CACjB,CACO,SAASiJ,GAAqBC,EAAW,CAC9C,MAAO,CAACnI,EAAQZ,IACPgJ,GAAO,IAAM3G,EAAkB1B,GAAgB,CACpD,OAAQC,EACR,IAAI,MAAO,CACT,OAAOZ,EAAQ,IACjB,EACA,UAAW+I,CACb,CAAC,EAAG/I,CAAO,CAEf,CACAiJ,GAAiB,CAAC,OAAO,CAAC",
|
|
6
|
-
"names": ["_$template", "_$delegateEvents", "_$memo", "_$setStyleProperty", "_$setAttribute", "_$effect", "_$getOwner", "_$use", "_$insert", "_$createComponent", "subscribe", "_$template", "_$delegateEvents", "_$memo", "_$insert", "_$createComponent", "For", "Show", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "SidebarWidgets", "props", "addDocumentList", "root", "handle", "doc", "DOCUMENT_LIST_TOOL", "_el$", "_$insert", "_$createComponent", "Show", "_$memo", "_el$2", "_el$3", "For", "widget", "_el$4", "SlotView", "_$delegateEvents", "_$template", "_$setAttribute", "_$effect", "_$insert", "_$createComponent", "For", "Show", "_tmpl$", "_$template", "_tmpl$2", "Tray", "props", "_$createComponent", "Show", "_el$", "_$insert", "For", "uniqueSlots", "slot", "_el$2", "SlotView", "_$effect", "_$setAttribute", "slotId", "createEffect", "createMemo", "createSignal", "onCleanup", "onMount", "Show", "render", "createDocOfDatatype2", "getRegistry", "loadDatatypeWhenReady", "id", "INTRINSIC_DOCTITLE_TOOLS", "defaultSidebarWidgets", "rootFolderUrl", "DOCUMENT_LIST_TOOL", "migrateThreepaneConfig", "doc", "DEFAULT_TRAY_TOOLS", "unique", "uniqueSlots", "present", "s", "slotId", "id", "DEFAULT_DOCTITLE_TOOLS", "ensureThreepaneConfig", "accountHandle", "repo", "existingConfigUrl", "configHandle", "datatype", "loadDatatypeWhenReady", "account", "doctitleTools", "createDocOfDatatype2", "acc", "import_debug", "createDocOfDatatype2", "log", "debug", "seedExampleDocuments", "accountHandle", "repo", "account", "doc", "rootFolder", "existingDocs", "gaios", "initUrls", "bundleInitScriptUrls", "folderDatatype", "loadDatatypeWhenReady", "folder", "createDocOfDatatype2", "seedGaiosExamples", "url", "err", "seeded", "TOOLS_BUNDLE_INIT_URL", "BASE_BUNDLE_INIT_URL", "siteExamplesOnly", "siteOnly", "watcher", "fromManifests", "base", "createEffect", "createMemo", "createSignal", "onCleanup", "useHandleDoc", "handle", "version", "setVersion", "h", "onChange", "v", "_tmpl$", "_$template", "_tmpl$2", "_tmpl$3", "_tmpl$4", "_tmpl$5", "_tmpl$6", "_tmpl$7", "_tmpl$8", "_tmpl$9", "_tmpl$0", "useFrameProviderReady", "componentId", "element", "isReady", "setReady", "createSignal", "createEffect", "el", "onMounted", "event", "onCleanup", "dispatchOpen", "detail", "PatchworkFrame", "handle", "repo", "props", "ensureFrameStyles", "accountDocUrl", "accountProviderElement", "setAccountProviderElement", "isAccountProviderReady", "toolStorageProviderElement", "setToolStorageProviderElement", "isToolStorageProviderReady", "selectedDocProviderElement", "setSelectedDocProviderElement", "isSelectedDocProviderReady", "areProvidersReady", "createMemo", "_el$", "_el$2", "_el$3", "_el$4", "_el$5", "_el$6", "_el$7", "_el$8", "_$insert", "_$createComponent", "Show", "_$use", "_$getOwner", "PatchworkFrameInner", "accountDocHandle", "useDocHandle", "ensureThreepaneConfig", "seedExampleDocuments", "err", "accountDoc", "useHandleDoc", "threepaneUrl", "threepaneConfigHandle", "threepaneConfig", "doctitleSlots", "sidebarWidgets", "traySlots", "rootFolderUrl", "sidebarState", "useSidebarState", "sidebarResize", "useSidebarResize", "selectedView", "setSelectedView", "popoverView", "setPopoverView", "onMount", "unsubscribeSelectedView", "subscribe", "view", "selectedDocUrl", "selectedToolId", "initialRightWidth", "getStoredNumber", "SIDEBAR_KEYS", "DEFAULT_SIDEBAR_WIDTH", "initialRightCollapsed", "getStoredBoolean", "mainDocElement", "setMainDocElement", "isMainDocMounted", "useMainDocMounted", "widgetsReady", "setWidgetsReady", "_el$9", "_ref$", "FrameLayout", "_el$0", "MainDocumentView", "DocumentAreaRoot", "IsolatedDocumentArea", "FramePopover", "toolId", "setToolId", "popoverEl", "onKey", "e", "onOpen", "url", "nextToolId", "_el$1", "_el$10", "_el$11", "_el$12", "_el$13", "_el$14", "_ref$2", "_$effect", "_p$", "_v$", "_v$2", "_v$3", "isCollapsed", "hasTray", "sidebarContentEl", "footerEl", "footer", "COLLAPSE_CONTEXT_SIDEBAR_EVENT", "_el$15", "v", "PanelLeftIcon", "_v$4", "_v$5", "_v$6", "_$setAttribute", "Sidebar", "_el$16", "_el$17", "_el$18", "_el$19", "_ref$3", "SidebarWidgets", "_ref$4", "contactUrl", "_el$21", "_el$22", "moduleSettingsUrl", "_el$23", "_el$20", "Tray", "_v$7", "_v$8", "_$setStyleProperty", "_$memo", "renderPatchworkFrame", "isolation", "render", "_$delegateEvents"]
|
|
7
|
-
}
|