@kedem/okdb 2.2.0 → 2.3.0
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/CHANGELOG.md +317 -0
- package/algorithm-worker-thread.js +1 -1
- package/bin/okdb.js +1 -1
- package/docs/embeddings.md +83 -5
- package/docs/fts.md +1 -1
- package/docs/licensing.md +75 -14
- package/docs/manifest.json +1 -0
- package/docs/resolved-fields.md +79 -0
- package/okdb-functions-sandbox-worker.js +1 -1
- package/okdb-http-worker-child.js +1 -1
- package/okdb-views-bootstrap-worker.js +1 -1
- package/okdb.js +1 -1
- package/package.json +1 -1
- package/public/modules/ok.js +1 -1
- package/public/sections/db/modals/create-env-modal.ok.js +1 -1
- package/public/sections/db/modals/remove-env-modal.ok.js +1 -1
- package/public/sections/db/modals/schema-edit-modal.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-create-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/embed-search-panel.ok.js +1 -1
- package/public/sections/embeddings/parts/pipeline-try-search.ok.js +1 -1
- package/public/sections/license/parts/license-panel.ok.js +1 -1
- package/public/sections/queue/modals/create-bucket-modal.ok.js +1 -1
- package/public/sections/queue/modals/edit-bucket-modal.ok.js +1 -1
- package/public/sections/sync/index.ok.html +2 -2
- package/public/sections/sync/modals/connect-peer-modal.ok.js +1 -1
- package/public/sections/system/parts/system-sync-panel.ok.js +1 -1
- package/public/vendor/okjs/ok.esm.min.js +1 -1
- package/public/vendor/okjs/toolkit/devtools/devtools-window.js +1 -0
- package/public/vendor/okjs/toolkit/devtools/ok-console.ok.js +1 -1
- package/public/vendor/okjs/toolkit/devtools/ok-crash-explorer-service.ok.js +1 -0
- package/public/vendor/okjs/toolkit/devtools/ok-crash-explorer.ok.js +1 -0
- package/public/vendor/okjs/toolkit/elements/ok-icon.ok.js +1 -1
- package/public/vendor/okjs/toolkit/errors/crash-minimal.ok.js +1 -0
- package/public/vendor/okjs/toolkit/errors/ok-crash-boundary.ok.js +1 -1
- package/public/vendor/okjs/toolkit/errors/ok-crash-info.ok.js +1 -1
- package/public/vendor/okjs/toolkit/manifest.js +1 -1
- package/types/environment.d.ts +26 -0
- package/types/features/licenses.d.ts +86 -0
- package/types/index.d.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o={"--ok-window_bg":"#17161a","--ok-window_footer-bg":"#121114","--ok-window_radius":"10px","--ok-window_shadow":"0 18px 48px rgba(0, 0, 0, .55)","--ok-window_padding":"0"},w=(w="#3a3a42")=>({set:{...o,"--ok-window_header-bg":w}}),n=(w="#3a3a42")=>`\n[tag] ok-window {\n --ok-window_bg: ${o["--ok-window_bg"]};\n --ok-window_footer-bg: ${o["--ok-window_footer-bg"]};\n --ok-window_header-bg: ${w};\n --ok-window_radius: ${o["--ok-window_radius"]};\n --ok-window_shadow: ${o["--ok-window_shadow"]};\n --ok-window_padding: 0;\n --ok_fg: #e6e1e1;\n width: min(62rem, 92vw);\n height: min(40rem, 82vh);\n}\n`;export{o as DEVTOOLS_WINDOW,w as devtoolsWindow,n as devtoolsWindowCss};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=/^(cmp:|path:|tag:)/;var o={tag:"console",dependencies:["./ok-console-service.ok.js"],context:o=>({query:"",collapsed:new WeakSet,activeTag:null,verbose:!1,get logs(){const e=o.$ok.shared.console.logs;if(this.activeTag)return e.filter(e=>e.tags.includes(this.activeTag));if(!this.query)return e;const t=this.query.toLowerCase();return e.filter(e=>e.tags.some(e=>e.toLowerCase().includes(t))||JSON.stringify(e.data).toLowerCase().includes(t))},get allTags(){const t=new Set;for(const a of o.$ok.shared.console.logs)for(const o of a.tags)!this.verbose&&e.test(o)||t.add(o);return[...t].sort()},visibleTags(o){return this.verbose?o.tags:o.tags.filter(o=>!e.test(o))},toggle(e){this.collapsed.has(e)?this.collapsed.delete(e):this.collapsed.add(e)},isCollapsed(e){return this.collapsed.has(e)},clear(){o.$ok.shared.console.clear()},remove(e){o.$ok.shared.console.remove(e)},filterBy(e){this.activeTag=this.activeTag===e?null:e,this.query=""}}),mounted(e){const o=new MutationObserver(()=>{const o=e.$el.querySelector(".logs");o.scrollTop=o.scrollHeight});e.$ext("unmount",()=>o.disconnect())},template:'<div class="toolbar"><input type="text" :bind="query" placeholder="Search logs..."><label class="verbose-toggle" title="Show internal tags (component ids, paths)"><input type="checkbox" :checked="verbose" @input="verbose = $el.checked">internal</label> <button @click="clear">Clear</button></div><div class="tags"><each :="allTags" let:item="tag"><button class="tag-btn" :class="{ active: activeTag === tag }" @click="filterBy(tag)">{{ tag }}</button></each></div><div class="logs"><virtualized :="logs" pin="bottom" let:item="log"><div class="log" :class="[ log.tags.includes(\'error\') && \'error\', log.tags.includes(\'warn\') && \'warn\', log.tags.includes(\'info\') && \'info\', log.tags.includes(\'verbose\') && \'verbose\', isCollapsed(log) && \'collapsed\' ]"><div class="header" @click="toggle(log)"><span class="tags"><each :="visibleTags(log)" let:item="tag"><span class="tag">{{ tag }}</span></each></span><span class="time">{{ new Date(log.timestamp).toLocaleTimeString() }}</span> <button class="remove" @click="remove(log)">✕</button></div><if :="log.data instanceof Error"><
|
|
1
|
+
const e=/^(cmp:|path:|tag:)/;var o={tag:"console",dependencies:["./ok-console-service.ok.js"],context:o=>({query:"",collapsed:new WeakSet,activeTag:null,verbose:!1,get logs(){const e=o.$ok.shared.console.logs;if(this.activeTag)return e.filter(e=>e.tags.includes(this.activeTag));if(!this.query)return e;const t=this.query.toLowerCase();return e.filter(e=>e.tags.some(e=>e.toLowerCase().includes(t))||JSON.stringify(e.data).toLowerCase().includes(t))},get allTags(){const t=new Set;for(const a of o.$ok.shared.console.logs)for(const o of a.tags)!this.verbose&&e.test(o)||t.add(o);return[...t].sort()},visibleTags(o){return this.verbose?o.tags:o.tags.filter(o=>!e.test(o))},toggle(e){this.collapsed.has(e)?this.collapsed.delete(e):this.collapsed.add(e)},isCollapsed(e){return this.collapsed.has(e)},clear(){o.$ok.shared.console.clear()},errorText:e=>e?.stack||`${e?.name||"Error"}: ${e?.message||e}`,reportFor:e=>e?._ok_report||null,remove(e){o.$ok.shared.console.remove(e)},filterBy(e){this.activeTag=this.activeTag===e?null:e,this.query=""}}),mounted(e){const o=new MutationObserver(()=>{const o=e.$el.querySelector(".logs");o.scrollTop=o.scrollHeight});e.$ext("unmount",()=>o.disconnect())},template:'<div class="toolbar"><input type="text" :bind="query" placeholder="Search logs..."><label class="verbose-toggle" title="Show internal tags (component ids, paths)"><input type="checkbox" :checked="verbose" @input="verbose = $el.checked">internal</label> <button @click="clear">Clear</button></div><div class="tags"><each :="allTags" let:item="tag"><button class="tag-btn" :class="{ active: activeTag === tag }" @click="filterBy(tag)">{{ tag }}</button></each></div><div class="logs"><virtualized :="logs" pin="bottom" let:item="log"><div class="log" :class="[ log.tags.includes(\'error\') && \'error\', log.tags.includes(\'warn\') && \'warn\', log.tags.includes(\'info\') && \'info\', log.tags.includes(\'verbose\') && \'verbose\', isCollapsed(log) && \'collapsed\' ]"><div class="header" @click="toggle(log)"><span class="tags"><each :="visibleTags(log)" let:item="tag"><span class="tag">{{ tag }}</span></each></span><span class="time">{{ new Date(log.timestamp).toLocaleTimeString() }}</span> <button class="remove" @click="remove(log)">✕</button></div><if :="log.data instanceof Error"><pre class="data">{{ errorText(log.data) }}</pre><if :="$ok.shared.crashViewer && reportFor(log.data)"><button class="remove" @click="$ok.shared.crashViewer.open(reportFor(log.data))">Open crash report</button></if><else><pre class="data">{{ JSON.stringify(log.data, null, 2) }}</pre></else></if></div></virtualized></div>',style:"[tag]{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;font-family:monospace;font-size:12px}.toolbar,.verbose-toggle{display:flex;align-items:center}.toolbar{gap:6px;padding:4px;background:rgba(128,128,128,.08);border-bottom:var(--ok_border-muted, 1px solid rgba(128,128,128,0.25));flex:none}.toolbar button,.toolbar input[type=text]{background:0 0;color:inherit;box-shadow:none;border:var(--ok_border-muted, 1px solid rgba(128,128,128,0.35));border-radius:4px;font:inherit}.toolbar input[type=text]{flex:1;padding:2px 6px}.verbose-toggle{gap:4px;opacity:.7;white-space:nowrap;cursor:pointer}.toolbar button{padding:2px 10px;cursor:pointer}.toolbar button:hover{background:rgba(128,128,128,.15);box-shadow:none}.tags{display:flex;flex-wrap:wrap;gap:4px;padding:4px;flex:none}.tags:empty{display:none}.tag-btn{padding:1px 6px;border:0;box-shadow:none;background:rgba(128,128,128,.18);color:inherit;cursor:pointer;border-radius:4px;font-size:.85em;opacity:.85}.tag-btn.active{background:var(--ok_fg-accent, #09f);color:#fff;opacity:1}.logs{flex:1;overflow:auto}.log{border-bottom:1px solid rgba(128,128,128,.15)}.log .header{display:flex;justify-content:space-between;align-items:center;padding:3px 4px;cursor:pointer}.log .header:hover{background:rgba(128,128,128,.08)}.log.collapsed .data{display:none}.log .tags{display:flex;gap:6px;flex-wrap:wrap;padding:0}.log .tag{background:rgba(128,128,128,.18);padding:1px 6px;border-radius:4px;font-size:.85em}.log .time{font-size:.75em;opacity:.55;margin-left:auto;margin-right:8px}.log .remove{background:0 0;border:0;box-shadow:none;color:inherit;opacity:.5;font-size:1em;cursor:pointer}.log .remove:hover{opacity:1}.log .data{padding:4px 8px;white-space:pre-wrap;word-break:break-word;opacity:.9}.log.info .tag{background:color-mix(in srgb,#3af 20%,transparent)}.log.warn .tag{background:color-mix(in srgb,#fc2 25%,transparent)}.log.error .tag{background:color-mix(in srgb,#f45 25%,transparent)}.log.error .header{box-shadow:inset 2px 0 0#f45}.log.warn .header{box-shadow:inset 2px 0 0#fc2}.log.verbose .tag{opacity:.6}"};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../modals/ok-window.ok.js";import o from"./ok-crash-explorer.ok.js";import{devtoolsWindowCss as r,devtoolsWindow as s}from"./devtools-window.js";var t={tag:"ok-crash-explorer-service",dependencies:[e,o],plugins:{theme:s("#8b1a1a")},style:r("#8b1a1a"),register(e,o){e.shared.crashViewer={window:null,scope:null,async toggle(r=null){const s=await e.shared.layer.toggle("ok-crash-explorer-service",r,{registration:o,tier:"window"});return this.window=s?.$scope||null,this.scope=s?.querySelector("ok-crash-explorer")?.$scope||null,this.scope},async open(e=null){return await this.toggle(!0),e&&this.scope?.$innerContext.select(e),this.scope},close(){return this.toggle(!1)}}},template:'<ok-window no-portal @close="$ok.shared.crashViewer.toggle(false)" title="Crash reports"><ok-crash-explorer/></ok-window>'};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./ok-js-tree.ok.js";var t={tag:"ok-crash-explorer",dependencies:[e],attr:{report:{}},context(e){let t=new Map,o=null;const r=(e,r,i)=>(o!==i&&(t=new Map,o=i),t.has(e)||t.set(e,r()),t.get(e));return{picked:null,tick:0,view:"story",format:"fields",get reports(){this.tick;const t=this.picked||e.$attr.report||null,o=[...t?._error?.ok?.report?.reports||e.$ok.report?.reports||[]];return t&&!o.some(e=>e.id===t.id)&&o.unshift(t),o},get current(){return this.picked||e.$attr.report||this.reports[0]||null},select(e){this.picked=e,t=new Map},isCurrent(e){return!!e&&e.id===this.current?.id},label:e=>e.error?.code||e.error?.chain?.[0]?.name||"Error",subject:e=>e.ok?.component?.tag||e.ok?.binding?.expr||e.error?.origin||e.page?.url||"",when(e){const t=Date.parse(e.at);return Number.isNaN(t)?"":new Date(t).toLocaleTimeString()},get probe(){return this.current?.ok?.probe?.[0]||null},get headline(){return this.current?.error.summary||this.current?.error.headline||""},get subtitle(){const e=this.current?.error.chain?.at(-1);return this.probe?e?.message||null:this.current?.error.origin||null},get binding(){const e=this.current?.ok?.binding;return e?e.attr?`${e.attr}="${e.expr}"`:`{{ ${e.expr} }}`:null},get props(){const e=this.current?.ok?.props;return e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(" · "):null},get frame(){const e=this.current?.ok?.source;return e?.lines?e.lines.map((t,o)=>({n:e.from+o,text:t.replace(/\t/g," "),bad:e.from+o===e.line})):null},stepCmp(e){const t=e.scope?.cmp;return t&&t!==this.current?.ok?.component?.tag?t:null},stepNode(e){const t=e.scope?.node;return t&&t!==this.current?.ok?.node?t:null},stepBinding(e){const t=e.binding;return t?.expr&&t.expr!==this.current?.ok?.binding?.expr?t.attr?`${t.attr}="${t.expr}"`:`{{ ${t.expr} }}`:null},hasPlace(e){return!!(this.stepCmp(e)||this.stepNode(e)||this.stepBinding(e))},get metaLine(){const e=this.current?.ok?.meta;return e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(" · "):null},get causes(){return this.current?.error.chain||[]},get steps(){return r("steps",()=>this.causes.map((e,t)=>({entry:e,index:t,wrapper:!e.message})),this.current?.id)},get wrapperCount(){return this.steps.filter(e=>e.wrapper).length},get visibleSteps(){return this.chainOpen?this.steps:this.steps.filter(e=>!e.wrapper)},chainOpen:!1,targetIndex:-1,toggleChain(){this.chainOpen=!this.chainOpen},framesText:e=>(e.frames||[]).join("\n"),hasFrames:e=>(e.frames||[]).some(e=>!/^… \d+ okjs frames?$/.test(e)),get liveErrors(){return r("live",()=>{const e=[];for(let t=this.current?._error;t&&"object"==typeof t&&"string"==typeof t.message&&e.length<12;t=t.cause)e.push(t);return e.length===this.causes.length?e:[]},this.current?.id)},liveAt(e){return this.liveErrors[e]||null},liveScope(e){const t=this.liveAt(e)?.scope;return t&&t!==this.liveAt(e+1)?.scope?t:null},scopeData(e){return r("state:"+e,()=>{const t=this.liveScope(e);if(!t)return null;const o={};try{t.$attr&&Object.keys(t.$attr).length&&(o.$attr=t.$attr);for(const[e,r]of Object.entries(t.$context||{}))o[e]=r}catch{return null}return Object.keys(o).length?o:null},this.current?.id)},liveMeta(e){return r("meta:"+e,()=>{const t=this.liveAt(e)?.meta;if(!t)return null;const o={};for(const[e,r]of Object.entries(t))"_binding"!==e&&"_probe"!==e&&(o[e]=r);return Object.keys(o).length?o:null},this.current?.id)},liveNode(e){const t=this.liveAt(e);return t?.node||t?.scope?.$el||t?.meta?.node||null},isNode:e=>!!e&&"object"==typeof e&&1===e.nodeType,nodeText(e){const t=[...e.attributes||[]].map(e=>`${e.name}="${e.value}"`).join(" ");return`<${e.tagName.toLowerCase()}${t?" "+t:""}>`},stringify(e){try{return JSON.stringify(e,(e,t)=>"function"==typeof t?"[Function]":t,2)}catch{return"[Circular]"}},get trail(){return r("trail",()=>{const e=this.liveErrors.filter(e=>e.scope).at(-1)?.scope||null,t=[];for(let o=e,r=0;o&&r<32;o=o.$parent,r++)!o.$cache?.cmp&&o!==e&&o.$parent||t.unshift(o);const o=this.current?.ok?.where||[];return o.length===t.length?o.map((e,o)=>({...e,scope:t[o]})):o.map(e=>({...e,scope:null}))},this.current?.id)},causeIndex(e){const t=e.scope?.$id;return null==t?-1:this.causes.findIndex(e=>e.scope?.id===t)},focusCause(t){const o=this.causeIndex(t);o<0||(this.chainOpen=!0,this.targetIndex=o,setTimeout(()=>{this.targetIndex===o&&(this.targetIndex=-1)},1400),e.$ok.nextFrame(()=>{const t=e.$el.querySelector(`.ok-cx-cause[data-i="${o}"]`);try{t?.scrollIntoView({behavior:"smooth",block:"center"})}catch{}}))},canInspect:t=>!!t?.isConnected&&!!e.$ok.shared?.inspector,inspect(t){if(t?.isConnected){try{e.$ok.shared.highlight?.show(t)}catch{}(t.$scope||e).$ok.shared.inspector?.inspect(t)}},peek(t){if(t?.isConnected)try{e.$ok.shared.highlight?.show(t)}catch{}},unpeek(){try{e.$ok.shared.highlight?.hide?.()}catch{}},get sourceUrl(){return this.current?.ok?.component?.url||null},shortUrl(t){if(!t)return"";try{return new URL(t,e.$ok.config.window?.location?.href).pathname}catch{return t}},get pathLine(){const e=this.current?.ok?.source?.line;return this.sourceUrl?this.shortUrl(this.sourceUrl)+(e?":"+e:""):null},frameParts(e){const t=/^(.*?)\s*[(@]?((?:https?|file):\/\/[^\s)]+?):(\d+):(\d+)\)?$/.exec(e);return t?{text:t[1].replace(/^at\s+/,"").trim(),url:t[2],line:t[3],col:t[4]}:{text:e,url:null}},frameList(e){return r("frames:"+e.name+(e.code||""),()=>(e.frames||[]).map(e=>this.frameParts(e)),this.current?.id)},async copyText(t){try{await(e.$ok.config.window?.navigator?.clipboard?.writeText(t))}catch{}this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)},setView(e){this.view=e},setFormat(e){this.format=e},get json(){return e.$ok.report.json(this.current)},copied:!1,async copy(t){await e.$ok.report.copy(t?this.reports:this.current),this.copied=!0,setTimeout(()=>{this.copied=!1},2e3)}}},mount(e){const t=e.$ok.on("report",()=>{e.$innerContext.tick++});e.$ext("unmount",()=>t?.stop?.())},template:'<div class="ok-cx"><aside class="ok-cx-list"><if :="reports.length"><each :of="reports" let:item><button :class="isCurrent(item) ? \'ok-cx-item on\' : \'ok-cx-item\'" @click="select(item)"><span class="ok-cx-item-head"><span class="ok-cx-code">{{ label(item) }}</span><if :="item.count > 1"><span class="ok-cx-count">×{{ item.count }}</span></if></span><span class="ok-cx-subject">{{ subject(item) }}</span> <span class="ok-cx-meta">{{ item.handled }} · {{ when(item) }}</span></button></each><else><p class="ok-cx-empty">No failures captured yet. They will appear here as they happen.</p></else></if></aside><section class="ok-cx-detail"><if :="current"><div class="ok-cx-bar"><span class="ok-cx-code">{{ current.error.code || \'Error\' }}</span><if :="current.ok.component"><code><{{ current.ok.component.tag }}></code></if><if :="binding"><code>{{ binding }}</code></if><span class="ok-cx-spacer"/> <span class="ok-cx-views"><button :class="view === \'story\' ? \'ok-cx-view on\' : \'ok-cx-view\'" @click="setView(\'story\')">Story</button> <button :class="view === \'report\' ? \'ok-cx-view on\' : \'ok-cx-view\'" @click="setView(\'report\')">Report</button> </span><button class="ok-cx-btn" @click="copy(false)">{{ copied ? \'Copied ✓\' : \'Copy report\' }}</button><if :="reports.length > 1"><button class="ok-cx-btn" @click="copy(true)">Copy all {{ reports.length }}</button></if></div><if :="view === \'report\'"><div class="ok-cx-formats"><span class="ok-cx-views"><button :class="format === \'fields\' ? \'ok-cx-view on\' : \'ok-cx-view\'" @click="setFormat(\'fields\')">Fields</button> <button :class="format === \'raw\' ? \'ok-cx-view on\' : \'ok-cx-view\'" @click="setFormat(\'raw\')">Raw</button></span></div></if><if :="view === \'report\' && format === \'fields\'"><div class="ok-cx-tree ok-cx-reporttree"><each :of="current" let:key><ok-js-tree :key :parent="current"/></each></div></if><if :="view === \'report\' && format === \'raw\'"><pre class="ok-cx-json">{{ json }}</pre></if><if :="view === \'story\'"><h1 class="ok-cx-headline">{{ headline }}</h1><if :="subtitle"><p class="ok-cx-sub">{{ subtitle }}</p></if><if :="frame"><div class="ok-cx-frame"><div class="ok-cx-frame-file"><if :="sourceUrl"><a :href="sourceUrl" target="_blank" rel="noopener">{{ shortUrl(sourceUrl) }}</a><else><span>{{ current.ok.component?.tag }}</span></else></if><span>· template L{{ current.ok.source.line }}</span><if :="pathLine"><button class="ok-cx-inspect" @click="copyText(pathLine)" title="Copy path:line">⧉</button></if></div><each :of="frame" let:item><div :class="item.bad ? \'ok-cx-line bad\' : \'ok-cx-line\'"><span class="ok-cx-n">{{ item.n }}</span>{{ item.text }}</div></each></div></if><if :="props"><p class="ok-cx-row"><strong>props</strong> {{ props }}</p></if><if :="current.error.origin"><p class="ok-cx-row"><strong>at</strong> {{ current.error.origin }}</p></if><if :="current.ok.node"><p class="ok-cx-row"><strong>node</strong> <code>{{ current.ok.node }}</code></p></if><if :="metaLine"><p class="ok-cx-row"><strong>meta</strong> {{ metaLine }}</p></if><if :="trail.length"><div class="ok-cx-path"><each :of="trail" let:item let:index><div :class="index === trail.length - 1 ? \'ok-cx-crumb at\' : \'ok-cx-crumb\'" :style="\'padding-left:\' + (index * 14 + 8) + \'px\'" @mouseenter="peek(item.scope?.$el)" @mouseleave="unpeek()"><if :="causeIndex(item) > -1"><a href="javascript:" @click="focusCause(item)"><code class="ok-cx-label">{{ item.label }}</code></a><else><code class="ok-cx-label">{{ item.label }}</code></else></if><if :="item.node"><code class="ok-cx-el">{{ item.node }}</code></if><if :="canInspect(item.scope?.$el)"><button class="ok-cx-inspect" @click="inspect(item.scope.$el)" title="Inspect">🔍</button></if></div></each></div></if><div class="ok-cx-chain"><div class="ok-cx-chain-head"><strong>Cause chain</strong> <span class="ok-cx-chain-n">{{ causes.length }} levels, innermost last</span><if :="wrapperCount"><button class="ok-cx-btn" @click="toggleChain()">{{ chainOpen ? \'Hide wrapping\' : \'+\' + wrapperCount + \' wrapping\' }}</button></if></div><each :of="visibleSteps" let:items let:item><div :data-i="item.index" :class="\'ok-cx-cause\' + (item.wrapper ? \' wrap\' : \'\') + (targetIndex === item.index ? \' is-target\' : \'\')"><div class="ok-cx-cause-head"><span class="ok-cx-cause-n">{{ item.index + 1 }}</span> <strong>{{ item.entry.code || item.entry.name }}</strong><if :="item.entry.scope"><code>{{ item.entry.scope.tag }}#{{ item.entry.scope.id }}<if :="item.entry.scope.state">({{ item.entry.scope.state }})</if></code></if><if :="canInspect(liveNode(item.index))"><button class="ok-cx-inspect" @click="inspect(liveNode(item.index))">Inspect</button></if></div><if :="item.entry.message"><p class="ok-cx-cause-msg">{{ item.entry.message }}</p></if><if :="hasPlace(item.entry)"><p class="ok-cx-place"><if :="stepCmp(item.entry)"><code><{{ stepCmp(item.entry) }}></code></if><if :="stepNode(item.entry)"><code>{{ stepNode(item.entry) }}</code></if><if :="stepBinding(item.entry)"><code>{{ stepBinding(item.entry) }}</code></if></p></if><if :="hasFrames(item.entry)"><div class="ok-cx-frames"><each :of="frameList(item.entry)" let:item="f"><div class="ok-cx-frame-line"><span>{{ f.text }}</span><if :="f.url"><a :href="f.url" target="_blank" rel="noopener">{{ shortUrl(f.url) }}</a>:{{ f.line }}:{{ f.col }}</if></div></each></div></if><if :="liveScope(item.index)"><details class="ok-cx-live"><summary>Scope</summary><div class="ok-cx-tree"><if :="scopeData(item.index)"><each :of="scopeData(item.index)" let:key><ok-js-tree :key :parent="scopeData(item.index)"/></each></if><details class="ok-cx-live"><summary>Everything on the scope</summary><div class="ok-cx-tree"><each :of="liveScope(item.index)" let:key><ok-js-tree :key :parent="liveScope(item.index)"/></each></div></details></div></details></if><if :="liveMeta(item.index)"><details class="ok-cx-live"><summary>Meta</summary><div class="ok-cx-tree"><each :of="liveMeta(item.index)" let:key let:value><div class="ok-cx-metarow"><strong>{{ key }}</strong><if :="isNode(value)"><code>{{ nodeText(value) }}</code><if :="canInspect(value)"><button class="ok-cx-inspect" @click="inspect(value)">Inspect</button></if><else><code>{{ stringify(value) }}</code></else></if></div></each></div></details></if></div></each></div></if><p class="ok-cx-row ok-cx-foot">{{ current.page?.url }} · {{ current.device?.vw }}×{{ current.device?.vh }} · okjs {{ current.okjs }} · {{ current.id }}</p><else><p class="ok-cx-empty">Pick a failure, or cause one.</p></else></if></section></div>',style:"[tag]{flex-direction:column;align-self:stretch;background:#17161a;color:#e6e1e1;font:13px/1.5 system-ui,sans-serif}[tag],[tag] .ok-cx{display:flex;flex:1 1 auto;min-height:0}[tag] .ok-cx-list{flex:none;width:15rem;min-width:0;min-height:0;overflow:auto;border-right:1px solid #2e2a2e}[tag] .ok-cx-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;appearance:none;font:inherit;cursor:pointer;padding:8px 10px;border:0;border-bottom:1px solid #232026;background:0 0;color:inherit}[tag] .ok-cx-item:hover{background:#201d22}[tag] .ok-cx-item.on{background:#2a1417;box-shadow:inset 3px 0 0#f44336}[tag] .ok-cx-item-head{display:flex;align-items:center;gap:6px}[tag] .ok-cx-meta,[tag] .ok-cx-subject{font:11px/1.4 ui-monospace,Menlo,monospace;color:#9c9299;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[tag] .ok-cx-count{font:11px/1 ui-monospace,Menlo,monospace;color:#e0a0a0}[tag] .ok-cx-detail{flex:1;min-width:0;min-height:0;overflow:auto;padding:14px 16px;display:flex;flex-direction:column}[tag] .ok-cx-detail>*{flex-shrink:0}[tag] .ok-cx-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px}[tag] .ok-cx-spacer{flex:1}[tag] .ok-cx-code{font:600 11px/1 ui-monospace,Menlo,monospace;letter-spacing:.04em;padding:4px 7px;border-radius:999px;background:rgba(244,67,54,.16);color:#ff9c9c}[tag] .ok-cx-btn{appearance:none;font:inherit;font-size:12px;padding:5px 10px;border-radius:8px;border:1px solid #3c3439;background:0 0;color:inherit;cursor:pointer}[tag] .ok-cx-btn:hover{border-color:#6b5a5f}[tag] .ok-cx-headline{margin:0;font-size:17px;line-height:1.35;font-weight:600;overflow-wrap:anywhere}[tag] .ok-cx-row,[tag] .ok-cx-sub{margin:4px 0 0;color:#b5a9ae;overflow-wrap:anywhere}[tag] .ok-cx-row{margin:6px 0 0;font-size:12px}[tag] .ok-cx-row strong{color:#8d8289;font-weight:600}[tag] .ok-cx-foot{flex:none;margin-top:14px;font:11px/1.5 ui-monospace,Menlo,monospace;color:#7d747a}[tag] code{font:11.5px/1.5 ui-monospace,Menlo,monospace}[tag] .ok-cx-frame{margin:12px 0;border:1px solid #332b30;border-radius:8px;background:#121114;overflow:auto}[tag] .ok-cx-frame-file{padding:5px 9px;border-bottom:1px solid #332b30;font:11px/1.4 ui-monospace,Menlo,monospace;color:#8d8289}[tag] .ok-cx-line{display:flex;gap:10px;padding:2px 9px;white-space:pre;font:12px/1.6 ui-monospace,Menlo,monospace;color:#c9bfc3}[tag] .ok-cx-line.bad{background:rgba(244,67,54,.14);color:#ffd9d9}[tag] .ok-cx-n{color:#6f656b;min-width:2ch;text-align:right}[tag] .ok-cx-path{margin:10px 0;border-left:2px solid #2e2a2e}[tag] .ok-cx-crumb{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;padding:2px 0;font:11.5px/1.7 ui-monospace,Menlo,monospace;color:#9c9299}[tag] .ok-cx-crumb.at{color:#e0b0b0}[tag] .ok-cx-el{color:#8d8289;overflow-wrap:anywhere}[tag] .ok-cx-crumb.at .ok-cx-el,[tag] code{color:#d7c2c2}[tag] .ok-cx-inspect{appearance:none;font:inherit;font-size:11px;margin-left:4px;padding:2px 5px;border-radius:5px;border:1px solid #3c3439;background:0 0;color:inherit;cursor:pointer}[tag] .ok-cx-chain{margin:14px 0 0;border:1px solid #332b30;border-radius:8px;overflow:hidden}[tag] .ok-cx-chain-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 10px;background:#1e1c21;border-bottom:1px solid #332b30}[tag] .ok-cx-chain-head strong{font-size:12px}[tag] .ok-cx-chain-n{flex:1;font:11px/1.4 ui-monospace,Menlo,monospace;color:#7d747a}[tag] .ok-cx-cause{padding:8px 10px 10px 22px;position:relative;transition:background-color .4s ease}[tag] .ok-cx-cause+.ok-cx-cause{border-top:1px solid #241f24}[tag] .ok-cx-cause::before{content:'';position:absolute;left:11px;top:0;bottom:0;border-left:1px solid #3d2b2e}[tag] .ok-cx-cause:first-child::before{top:14px}[tag] .ok-cx-cause:last-child::before{bottom:auto;height:14px}[tag] .ok-cx-cause.wrap,[tag] .ok-cx-cause.wrap .ok-cx-cause-n{background:#1a181c}[tag] .ok-cx-cause.wrap .ok-cx-cause-head strong{color:#9c9299;font-weight:500}[tag] .ok-cx-cause.is-target{background:rgba(244,67,54,.12);border-left-color:#f44336}[tag] .ok-cx-crumb a{color:inherit;text-decoration:underline dotted;cursor:pointer}[tag] .ok-cx-crumb a:hover,[tag] .ok-cx-frame-file a:hover,[tag] .ok-cx-frame-line a:hover{color:#ffb3b3}[tag] .ok-cx-cause-head{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}[tag] .ok-cx-cause-n{position:absolute;left:6px;width:12px;text-align:center;font:600 10px/1.6 ui-monospace,Menlo,monospace;color:#8d6b6b;background:#17161a}[tag] .ok-cx-cause-msg{margin:2px 0;font-size:12.5px;color:#b5a9ae;overflow-wrap:anywhere}[tag] .ok-cx-place{display:flex;gap:8px;flex-wrap:wrap;margin:3px 0 0}[tag] .ok-cx-place code{padding:1px 5px;border-radius:5px;background:#1e1c21}[tag] .ok-cx-frames{margin:4px 0 0;padding:6px 8px;border-radius:6px;background:#121114;max-height:30vh;overflow:auto}[tag] .ok-cx-live{margin:4px 0 0 2px;min-width:0}[tag] .ok-cx-live>summary{cursor:pointer;font-size:12px;color:#9c9299;padding:3px 0}[tag] .ok-cx-live>summary:hover{color:#e0a0a0}[tag] .ok-cx-tree{contain:inline-size;overflow:auto;max-height:50vh;background:#121114;border-radius:6px;padding:4px 0}[tag] .ok-cx-tree>.ok-cx-metarow,[tag] .ok-cx-tree>details,[tag] .ok-cx-tree>ok-js-tree{display:block;min-width:max-content}[tag] .ok-cx-metarow{margin:3px 0 0 12px;font-size:12px;color:#b5a9ae;overflow-wrap:anywhere}[tag] .ok-cx-metarow code{white-space:pre-wrap}[tag] .ok-cx-views{display:inline-flex;border:1px solid #3c3439;border-radius:8px;overflow:hidden}[tag] .ok-cx-view{appearance:none;font:inherit;font-size:11.5px;padding:4px 9px;border:0;background:0 0;color:#9c9299;cursor:pointer}[tag] .ok-cx-view.on{background:#2a1417;color:#ffd9d9}[tag] .ok-cx-formats{display:flex;margin:0 0 8px}[tag] .ok-cx-formats .ok-cx-views{border-color:#332b30}[tag] .ok-cx-formats .ok-cx-view{font-size:11px;padding:3px 7px}[tag] .ok-cx-formats .ok-cx-view.on{background:#221f24;color:#d7c2c2}[tag] .ok-cx-reporttree{flex:1 1 auto;max-height:none;margin-bottom:10px}[tag] .ok-cx-json{flex:1 1 auto;margin:0;padding:8px 10px;border-radius:8px;background:#121114;font:11px/1.6 ui-monospace,Menlo,monospace;color:#b5a9ae;white-space:pre-wrap;overflow-wrap:anywhere;overflow:visible;user-select:text;-webkit-user-select:text}[tag] .ok-cx-frame-line{display:flex;gap:8px;flex-wrap:wrap;padding:1px 0;font:11px/1.6 ui-monospace,Menlo,monospace;color:#9c9299}[tag] .ok-cx-frame-file a,[tag] .ok-cx-frame-line a{color:#d09a9a;text-decoration:underline dotted}[tag] .ok-cx-frame-file{display:flex;align-items:center;gap:6px;flex-wrap:wrap}[tag] .ok-cx-empty{margin:14px;color:#7d747a}@media (max-width:40rem){[tag] .ok-cx{flex-direction:column}[tag] .ok-cx-list{width:auto;max-height:9rem;border-right:0;border-bottom:1px solid #2e2a2e}}"};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=new Map;
|
|
1
|
+
const t="ok-icon/v1",e={"&":"&","<":"<",">":">",'"':"""},n={api:"https://api.iconify.design",persist:!0};function o(t){return{...n,...t?.config?.components?.["ok-icon"]??{}}}const s=new Map,r=new Map,a=new Map,i=new Set,c=new Map;let l=0,p=!1;function u(e){if(!e.persist)return!1;if(l)return 1===l;l=-1;try{const e=globalThis.localStorage?.getItem(t);if(e)for(const[t,n]of Object.entries(JSON.parse(e)))"string"!=typeof n||a.has(t)||(s.set(t,n),a.set(t,"net"));l=1}catch{}return 1===l}function f(t,e,n=0){const o=t.icons?.[e];if(o)return o;const s=t.aliases?.[e];if(!s||n>8)return null;const r=f(t,s.parent,n+1);return r?{...r,rotate:((r.rotate||0)+(s.rotate||0))%4,hFlip:!!r.hFlip!=!!s.hFlip,vFlip:!!r.vFlip!=!!s.vFlip}:null}function h(t,e){const n=t.width??e.width??16,o=t.height??e.height??16,s=t.left??0,r=t.top??0,a=(t.rotate||0)%4,i=[];1===a?i.push(`translate(${o} 0)`,"rotate(90)"):2===a?i.push(`translate(${n} ${o})`,"rotate(180)"):3===a&&i.push(`translate(0 ${n})`,"rotate(270)"),t.hFlip&&i.push(`translate(${n} 0)`,"scale(-1 1)"),t.vFlip&&i.push(`translate(0 ${o})`,"scale(1 -1)");const c=i.length&&(s||r);return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="${s} ${r} ${c||1!==a&&3!==a?n:o} ${c||1!==a&&3!==a?o:n}">${i.length&&!c?`<g transform="${i.join(" ")}">${t.body}</g>`:t.body}</svg>`}function $(e,n,o,r){const i=r?"net":"pack";for(const t of o){const o=`${e}/${t}`,r=a.get(o);if(r&&("pack"!==i||"net"!==r))continue;const c=f(n,t);c?.body&&(s.set(o,h(c,n)),a.set(o,i))}for(const t of n.not_found||[]){const n=`${e}/${t}`;"pack"!==a.get(n)&&(s.set(n,null),a.set(n,"net"))}r&&function(e){!p&&u(e)&&(p=!0,queueMicrotask(()=>{if(p=!1,!e.persist)return;const n={};for(const[t,e]of a){const o=s.get(t);"net"===e&&"string"==typeof o&&(n[t]=o)}try{globalThis.localStorage.setItem(t,JSON.stringify(n))}catch{try{globalThis.localStorage.removeItem(t)}catch{}l=-1}}))}(r)}function g(t,e,n){const o=`${t}/${e}`;if(s.has(o))return Promise.resolve(s.get(o));if(i.has(t)||!n.api)return Promise.resolve(null);const a=r.get(o);if(a)return a;let l=c.get(t);l||(l={names:new Set},l.run=new Promise(t=>setTimeout(t,0)).then(()=>(c.delete(t),async function(t,e,n){const o=e.filter(e=>!s.has(`${t}/${e}`));if(!o.length)return;const r=`${n.api}/${encodeURIComponent(t)}.json?icons=${o.map(encodeURIComponent).join(",")}`;try{const e=await fetch(r);if(!e.ok)throw new Error(`icon set "${t}" responded ${e.status}`);$(t,await e.json(),o,n)}catch{}}(t,[...l.names],n))),c.set(t,l)),l.names.add(e);const p=l.run.then(()=>(r.delete(o),s.has(o)?s.get(o):null));return r.set(o,p),p}function d(t,{complete:e=!1}={}){for(const n of Array.isArray(t)?t:[t]){const t=n?.prefix;t&&($(t,n,[...Object.keys(n.icons||{}),...Object.keys(n.aliases||{})],null),e&&i.add(t))}}function m(t,e="lucide",n=null){const s=o(n);return Promise.all(t.map(t=>g(e,t,s)))}function y(t){i.delete(t);const e=`${t}/`;for(const[t,n]of a)"pack"===n&&t.startsWith(e)&&(s.delete(t),a.delete(t))}function w(){for(const[t,e]of a)"net"===e&&(s.delete(t),a.delete(t));r.clear();try{globalThis.localStorage?.removeItem(t)}catch{}l=0}var v={tag:"ok-icon",attr:{name:{},set:{default:"lucide"},size:{}},context(t){let n=0,r=!1;const a=(n,o)=>{t.$el.innerHTML=n||(t=>{return`\x3c!-- icon "${n=t,String(n).replace(/[&<>"]/g,t=>e[t])}" not found --\x3e<span style="display:block;text-align:center">?</span>`;var n})(o)};return{applySize(){const e=t.$attr.size;null!=e&&""!==e?(t.$el.style.fontSize=/^\d+(\.\d+)?$/.test(String(e))?`${e}px`:String(e),r=!0):r&&(t.$el.style.fontSize="",r=!1)},async updateIcon(){const e=++n,r=t.$attr.name,i=t.$attr.set;if(!r)return void(t.$el.innerHTML="");const c=o(t.$ok);u(c);const l=`${i}/${r}`;if(s.has(l))return void a(s.get(l),r);t.$el.innerHTML='<span style="opacity:0.5"> </span>';const p=await g(i,r,c);t.$__unmount__$||e!==n||a(p,r)}}},mount(t){this.applySize(),this.updateIcon(),t.$watch(()=>[t.$attr.name,t.$attr.set],()=>{this.updateIcon()}),t.$watch(()=>t.$attr.size,()=>{this.applySize()})},style:"[tag]{display:inline-flex;width:1em;height:1em;line-height:1}[tag] svg{flex-grow:1;stroke:currentColor;fill:transparent;display:block}"};export{w as clearCache,v as default,n as defaults,m as preload,d as register,y as unregister};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={tag:"crash-minimal",attr:{error:{type:Object,default:null}},context:r=>({get report(){return r.$attr.error?._ok_report||null},get message(){return"dev"===r.$ok.config.env?this.report?.error.headline||r.$attr.error?.message||"Something went wrong":r.$ok.config.crash.text.body},copy(){r.$ok.report.copy(this.report)}}),template:'<div class="crash-minimal"><span class="crash-minimal__msg">{{ message }}</span><if :="$props.retry"><button @click="$props.retry()">Retry</button></if><if :="report"><button @click="copy()">Copy</button></if></div>',style:"[tag] .crash-minimal{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.5rem .75rem;border-left:3px solid #f44336;background:rgba(244,67,54,.08);font:inherit}[tag] .crash-minimal__msg{flex:1 1 12rem;min-width:0;overflow-wrap:anywhere}[tag] button{appearance:none;font:inherit;font-size:.85em;padding:.3em .7em;border:1px solid currentColor;border-radius:6px;background:0 0;color:inherit;cursor:pointer;opacity:.8}[tag] button:hover{opacity:1}"};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
let r=!1;var e={tag:"ok-crash-boundary",attr:{error:{type:Object,default:null}},register(e){r||(r=!0,e.log.warn(["ok-crash-boundary","DEPRECATED"],"ok-crash-boundary is deprecated and will be removed in okjs 2.0. It no longer replaces the crash boundary card; the built-in crash-boundary-default is used in every environment."))},template:'<crash-boundary-default :error="$props.error" :retry="$props.retry"/>',style:"[tag]{display:block}"};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let e=!1;var o={tag:"ok-crash-info",lazy:!0,attr:{noClose:{default:!1,empty:!0},error:{}},register(o,r){e||(e=!0,o.log.warn(["ok-crash-info","DEPRECATED"],"ok-crash-info is deprecated and will be removed in okjs 2.0. It no longer replaces the crash screen; register toolkit/devtools/ok-crash-explorer-service.ok.js for crash details instead.")),"dev"!==o.config.env||o.shared.crashViewer||import("../devtools/ok-crash-explorer-service.ok.js").then(({default:e})=>{if(o.shared.crashViewer)return;const t=o.componentRegistry.register(e,{parentId:r.id});return o.componentRegistry.init(t)}).catch(e=>{o.log.warn(["ok-crash-info"],"Could not install the crash explorer",e)})},context:e=>({get error(){const o=e.$attr.error;return"string"==typeof o?{message:o}:o||null},close(){e.$dispatch("close")}}),template:'<div class="ok-crash-info"><crash-boundary-default :error/><if :="!$props.noClose"><button class="ok-crash-info__close" @click="close()" title="Close" aria-label="Close">×</button></if></div>',style:"[tag]{display:block}[tag] .ok-crash-info{position:relative}[tag] .ok-crash-info__close{position:absolute;top:.25rem;right:.5rem;appearance:none;background:0 0;border:0;font:inherit;font-size:1.25rem;line-height:1;color:inherit;opacity:.7;cursor:pointer}[tag] .ok-crash-info__close:hover{opacity:1}"};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=import.meta.url;var o=[{tag:"async",path:"./behavior/async.ok.js",meta:["ui"],description:"Declarative promise handling — renders pending/resolved/rejected slots around an awaited expression."},{tag:"ok-theme",path:"./theming/ok-theme.ok.js",meta:["ui"],description:"Theme service — register/apply CSS variable presets via data-ok-theme; exposes scope.$ok.shared.theme."},{tag:"transition",path:"./core/transition.ok.js",meta:["ui"],description:"Enter/leave CSS transitions for content toggled by <if> or lists."},{tag:"virtualized",path:"./core/virtualized.ok.js",meta:["ui","heavy"],description:'Virtualized list — renders only visible items of a large array; pin="bottom" for chat/console feeds.'},{tag:"ok-overlay",path:"./core/ok-overlay.ok.js",meta:["ui"],description:"Full-viewport overlay layer for modal-style content."},{tag:"ok-layer",path:"./core/ok-layer.ok.js",meta:["ui"],description:"Ordered stacking layer host — portals content into z-index tiers."},{tag:"ok-layer-service",path:"./core/ok-layer-service.ok.js",meta:["service"],description:"Layer service — creates ordered layer handles (scope.$ok.shared.layer) used by modals, menus and flyovers."},{tag:"router",path:"./navigation/router.ok.js",meta:["ui"],description:"Route outlet — renders children matching the current route; base of hash/history routers."},{tag:"hash-router",path:"./navigation/hash-router.ok.js",meta:["ui"],description:"Client-side router driven by location.hash (#/path) — no server config needed."},{tag:"history-router",path:"./navigation/history-router.ok.js",meta:["ui"],description:"Client-side router using the History API (clean URLs; server must serve the app shell)."},{tag:"ok-icon",path:"./elements/ok-icon.ok.js",meta:["ui","cdn"],description:'Icon element — <ok-icon name="x" size="16"/> rendering from an
|
|
1
|
+
const e=import.meta.url;var o=[{tag:"async",path:"./behavior/async.ok.js",meta:["ui"],description:"Declarative promise handling — renders pending/resolved/rejected slots around an awaited expression."},{tag:"ok-theme",path:"./theming/ok-theme.ok.js",meta:["ui"],description:"Theme service — register/apply CSS variable presets via data-ok-theme; exposes scope.$ok.shared.theme."},{tag:"transition",path:"./core/transition.ok.js",meta:["ui"],description:"Enter/leave CSS transitions for content toggled by <if> or lists."},{tag:"virtualized",path:"./core/virtualized.ok.js",meta:["ui","heavy"],description:'Virtualized list — renders only visible items of a large array; pin="bottom" for chat/console feeds.'},{tag:"ok-overlay",path:"./core/ok-overlay.ok.js",meta:["ui"],description:"Full-viewport overlay layer for modal-style content."},{tag:"ok-layer",path:"./core/ok-layer.ok.js",meta:["ui"],description:"Ordered stacking layer host — portals content into z-index tiers."},{tag:"ok-layer-service",path:"./core/ok-layer-service.ok.js",meta:["service"],description:"Layer service — creates ordered layer handles (scope.$ok.shared.layer) used by modals, menus and flyovers."},{tag:"router",path:"./navigation/router.ok.js",meta:["ui"],description:"Route outlet — renders children matching the current route; base of hash/history routers."},{tag:"hash-router",path:"./navigation/hash-router.ok.js",meta:["ui"],description:"Client-side router driven by location.hash (#/path) — no server config needed."},{tag:"history-router",path:"./navigation/history-router.ok.js",meta:["ui"],description:"Client-side router using the History API (clean URLs; server must serve the app shell)."},{tag:"ok-icon",path:"./elements/ok-icon.ok.js",meta:["ui","cdn"],description:'Icon element — <ok-icon name="x" size="16"/> rendering from an Iconify set; batched, cached and packable for offline use.'},{tag:"ok-table",path:"./elements/ok-table.ok.js",meta:["ui","heavy"],description:"Data table with columns, sorting and row templates for arrays of objects."},{tag:"ok-dropdown",path:"./elements/ok-dropdown.ok.js",meta:["ui"],description:"Dropdown container — anchored panel that opens below a trigger element."},{tag:"ok-select",path:"./elements/ok-select.ok.js",meta:["ui"],description:"Select control — styled single-choice picker bound to a reactive value."},{tag:"ok-window",path:"./modals/ok-window.ok.js",meta:["ui"],description:"Draggable, resizable floating window with title bar and close button."},{tag:"ok-modal",path:"./modals/ok-modal.ok.js",meta:["ui"],description:"Modal dialog element — overlay + centered panel; pairs with ok-modal-service."},{tag:"ok-modal-service",path:"./modals/ok-modal-service.ok.js",meta:["service"],description:"Modal service — open dialogs programmatically: await scope.$ok.shared.modal.dialog({ title, content })."},{tag:"ok-toast-service",path:"./modals/ok-toast-service.ok.js",meta:["service"],description:"Toast notifications — scope.$ok.shared.toast.success/error/info/warning('message')."},{tag:"ok-contextmenu",path:"./interaction/ok-contextmenu.ok.js",meta:["ui"],description:"Right-click context menus — scope.$ok.shared.contextmenu.show({ target, context, items })."},{tag:"ok-popout",path:"./interaction/ok-popout.ok.js",meta:["ui"],description:"Pops its content into a separate browser window; state stays live-synced."},{tag:"ok-popout-service",path:"./interaction/ok-popout-service.ok.js",meta:["service"],description:"Popout service — scope.$ok.shared.popout.pop(template, { context, title }) opens live-synced windows."},{tag:"ok-picker-service",path:"./interaction/ok-picker-service.ok.js",meta:["service"],description:"Element picker — lets the user click an element on the page and returns it."},{tag:"ok-submenu",path:"./interaction/ok-submenu.ok.js",meta:["ui"],description:"Nested submenu item for context menus — opens a child panel on hover."},{tag:"ok-highlight",path:"./interaction/ok-highlight.ok.js",meta:["ui"],description:"Visual highlight box drawn over a target element (inspector-style)."},{tag:"ok-highlight-service",path:"./interaction/ok-highlight-service.ok.js",meta:["ui","service"],description:"Highlight service — programmatically flash/outline any element on screen."},{tag:"ok-draggable",path:"./interaction/ok-draggable.ok.js",meta:["ui"],description:"Makes its child element draggable (free move or handle-based)."},{tag:"ok-flyover",path:"./interaction/ok-flyover.ok.js",meta:["ui"],description:"Hover-triggered floating panel anchored to an element (tooltip/popover)."},{tag:"ok-flyover-panel",path:"./interaction/ok-flyover-panel.ok.js",meta:["ui"],description:"The floating panel used by ok-flyover — anchored, layered, dismissable."},{tag:"ok-hotkeys-service",path:"./interaction/ok-hotkeys-service.ok.js",meta:["service"],description:"Keyboard shortcuts — scope.$ok.shared.hotkeys.register({ keyCombo: ['ctrl','s'], keydown, label })."},{tag:"ok-dismiss-service",path:"./interaction/ok-dismiss-service.ok.js",meta:["service"],description:"Dismiss-on-outside-click/Escape service used by menus and panels."},{tag:"ok-portal-service",path:"./interaction/ok-portal-service.ok.js",meta:["service"],description:"Portal service — teleport existing DOM nodes to another target and back (scope.$ok.shared.portal)."},{tag:"ok-chart",path:"./components/ok-chart.ok.js",meta:["ui","heavy"],description:"Charts (line/bar/pie…) from reactive data series."},{tag:"ok-marked",path:"./components/ok-marked.ok.js",meta:["ui","cdn"],description:"Renders Markdown text as HTML (marked via CDN)."},{tag:"ok-doc-viewer",path:"./components/ok-doc-viewer.ok.js",meta:["ui","cdn"],description:"Documentation viewer — renders Markdown docs with navigation."},{tag:"ok-monaco",path:"./components/ok-monaco.ok.js",meta:["dev","editor","heavy","cdn"],description:"Monaco code editor — :value/:language/:markers/:reveal, @editor-change/@editor-save (CDN loaded)."},{tag:"ok-resizer",path:"./layout/ok-resizer.ok.js",meta:["ui"],description:"Drag-to-resize handle — resizes its previous sibling (or a target selector), horizontal or vertical."},{tag:"reactive-sync-service",path:"./sync/reactive-sync-service.ok.js",meta:["service"],description:"Real-time reactive state sync over any transport (BroadcastChannel, WebSocket…)."},{tag:"ok-console",path:"./devtools/ok-console.ok.js",meta:["dev","debug"],description:"In-page log console with tag filtering — shows scope.$log output."},{tag:"ok-console-service",path:"./devtools/ok-console-service.ok.js",meta:["dev","debug","service"],description:"Console service — toggle the log console programmatically (scope.$ok.shared.console)."},{tag:"ok-fps-monitor",path:"./devtools/ok-fps-monitor.ok.js",meta:["dev","debug"],description:"FPS/performance monitor widget."},{tag:"ok-fps-monitor-service",path:"./devtools/ok-fps-monitor-service.ok.js",meta:["dev","debug","service"],description:"FPS monitor service — toggle via scope.$ok.shared.fpsMonitor (ctrl+alt+f)."},{tag:"ok-inspector",path:"./devtools/ok-inspector.ok.js",meta:["dev","heavy","debug"],description:"Scope inspector — browse component scopes, attrs and reactive state live."},{tag:"ok-inspector-service",path:"./devtools/ok-inspector-service.ok.js",meta:["dev","debug","service"],description:"Inspector service — toggle the scope inspector (scope.$ok.shared.inspector)."},{tag:"ok-js-tree",path:"./devtools/ok-js-tree.ok.js",meta:["dev","editor"],description:"Collapsible JSON/object tree view for inspecting values."},{tag:"ok-live-shell",path:"./editor/ok-live-shell.ok.js",meta:["dev","editor","heavy"],description:"Live coding shell — edit and run OK components in-page (docs/demos)."},{tag:"ok-live-component",path:"./editor/ok-live-component.ok.js",meta:["dev","editor","heavy"],description:"Live-editable component block — source + rendered result side by side."},{tag:"ok-live-example",path:"./editor/ok-live-example.ok.js",meta:["dev","editor","heavy"],description:"Runnable documentation example — code block with live output."},{tag:"ok-theme-editor",path:"./theming/ok-theme-editor/ok-theme-editor.ok.js",meta:["dev","editor","heavy"],description:"Visual theme editor — tweak OKDesign CSS variables live and export a preset."},{tag:"ok-theme-editor-service",path:"./theming/ok-theme-editor/ok-theme-editor-service.ok.js",meta:["dev","editor","service"],description:"Theme editor service — open/close the theme editor programmatically."},{tag:"i18n-service",path:"./i18n/i18n-service.ok.js",meta:["service"],description:"Internationalization — $t('key', vars) in templates, language switching (scope.$ok.shared.i18n)."},{tag:"i18n-editor",path:"./i18n/i18n-editor.ok.js",meta:["dev","editor"],description:"Translation editor UI for i18n dictionaries."},{tag:"ok-crash-explorer-service",path:"./devtools/ok-crash-explorer-service.ok.js",meta:["dev","debug","service"],description:"Crash explorer — every failure this page load, with the code frame, cause chain and live scopes (ok.shared.crashViewer)."},{tag:"crash-minimal",path:"./errors/crash-minimal.ok.js",meta:["ui"],description:"Example crash screen — the whole contract for replacing okjs's own, in thirty lines."},{tag:"ok-sandbox",path:"./core/ok-sandbox.ok.js",meta:["ui","security"],description:"Renders untrusted content inside an isolated sandbox boundary."},{tag:"ok-timeline",path:"./devtools/ok-timeline.ok.js",meta:["dev","performance"],description:"Reactivity timeline — visualizes watcher runs and render flushes over time."},{tag:"ok-timeline-service",path:"./devtools/ok-timeline-service.ok.js",meta:["service","dev","performance"],description:"Timeline service — toggle the reactivity timeline (scope.$ok.shared.timeline)."}];export{e as base,o as default};
|
package/types/environment.d.ts
CHANGED
|
@@ -104,6 +104,32 @@ export interface OKDBEnvironment {
|
|
|
104
104
|
hasType(type: string): boolean;
|
|
105
105
|
dropType(type: string, timestamp?: number): Promise<void>;
|
|
106
106
|
|
|
107
|
+
// ── Resolved fields (content served by the app, never stored) ────────────
|
|
108
|
+
/**
|
|
109
|
+
* Serve `field` of `type` from `resolver` instead of storage: FTS, the embeddings indexer and
|
|
110
|
+
* search-result chunk text read it through the resolver when a row has no stored `field`.
|
|
111
|
+
* Return `null`/`undefined` for "no content"; throw for a read error (fails that item only).
|
|
112
|
+
* The declaration is durable; register the resolver in every process that runs those indexes,
|
|
113
|
+
* or they fail with FIELD_RESOLVER_MISSING. Resolves to an unregister function.
|
|
114
|
+
*/
|
|
115
|
+
resolveField(
|
|
116
|
+
type: string,
|
|
117
|
+
field: string,
|
|
118
|
+
resolver: ((row: any, key: string) => unknown | Promise<unknown>) | null,
|
|
119
|
+
options?: {
|
|
120
|
+
/** Resolve many rows per call: values in input order; an Error value fails that item only. */
|
|
121
|
+
batch?: (items: Array<{ row: any; key: string }>) => Promise<unknown[]>;
|
|
122
|
+
/** Rows per batch call (default 256). */
|
|
123
|
+
batchSize?: number;
|
|
124
|
+
},
|
|
125
|
+
): Promise<() => void>;
|
|
126
|
+
/** Remove the declaration and this process's resolver. */
|
|
127
|
+
unresolveField(type: string, field: string): Promise<void>;
|
|
128
|
+
/** Fields of `type` declared as resolved. */
|
|
129
|
+
resolvedFields(type: string): string[];
|
|
130
|
+
/** `field` of one row: the stored value, else the resolver's. */
|
|
131
|
+
readField(type: string, key: string, value: any, field: string): Promise<unknown>;
|
|
132
|
+
|
|
107
133
|
// ── Schema ────────────────────────────────────────────────────────────────
|
|
108
134
|
setSchema(type: string, schema: OKDBTypeSchema): Promise<void>;
|
|
109
135
|
getSchema(type: string): OKDBTypeSchema | null;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Feature flags a license (or the free tier) enables. */
|
|
2
|
+
export interface OKDBLicenseFeatures {
|
|
3
|
+
sync?: boolean;
|
|
4
|
+
embeddings?: boolean;
|
|
5
|
+
engines?: boolean;
|
|
6
|
+
fts?: boolean;
|
|
7
|
+
timeMachine?: boolean;
|
|
8
|
+
views?: boolean;
|
|
9
|
+
mcp?: boolean;
|
|
10
|
+
files?: boolean;
|
|
11
|
+
[feature: string]: boolean | undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Limits a license (or the free tier) sets. Unset / 0 / null = unlimited. */
|
|
15
|
+
export interface OKDBLicenseLimits {
|
|
16
|
+
envs?: number | null;
|
|
17
|
+
typesPerEnv?: number | null;
|
|
18
|
+
syncPeers?: number | null;
|
|
19
|
+
maxWrites?: number | null;
|
|
20
|
+
/** Free-tier only — the license format has no such field. */
|
|
21
|
+
pipelinesPerEnv?: number | null;
|
|
22
|
+
[limit: string]: number | null | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A stored license, summarized. Never carries the raw blob or activation token. */
|
|
26
|
+
export interface OKDBLicenseSummary {
|
|
27
|
+
id: string;
|
|
28
|
+
/** standard = node-bound (PIN → activation token); open = ≤6 months, not node-bound;
|
|
29
|
+
* internal = vendor, no expiry, not node-bound. */
|
|
30
|
+
type: 'standard' | 'open' | 'internal';
|
|
31
|
+
licensee: string | null;
|
|
32
|
+
/** Status on THIS node. `pending` = stored, awaiting its activation token. */
|
|
33
|
+
status: 'active' | 'pending' | 'expired' | 'wrong_node' | 'invalid';
|
|
34
|
+
/** True for the license currently in effect (the first active one). */
|
|
35
|
+
effective: boolean;
|
|
36
|
+
/** Standard license awaiting (re-)activation on this node — send `pin` to the vendor. */
|
|
37
|
+
needsActivation: boolean;
|
|
38
|
+
/** This node's PIN for a standard license (safe to share); null for open/internal. */
|
|
39
|
+
pin: string | null;
|
|
40
|
+
addedAt: number | null;
|
|
41
|
+
/** Epoch ms; null for internal licenses (no expiry). */
|
|
42
|
+
expiresAt: number | null;
|
|
43
|
+
features: OKDBLicenseFeatures;
|
|
44
|
+
limits: OKDBLicenseLimits;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Result of a mutation: the summary plus whether anything was written (false = no-op). */
|
|
48
|
+
export interface OKDBLicenseChange extends OKDBLicenseSummary {
|
|
49
|
+
changed: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface OKDBEffectiveLicense {
|
|
53
|
+
/** True when no license is active and the free tier applies. */
|
|
54
|
+
free: boolean;
|
|
55
|
+
id: string | null;
|
|
56
|
+
type: 'free' | 'standard' | 'open' | 'internal';
|
|
57
|
+
licensee: string | null;
|
|
58
|
+
expiresAt: number | null;
|
|
59
|
+
features: OKDBLicenseFeatures;
|
|
60
|
+
limits: OKDBLicenseLimits;
|
|
61
|
+
/** False on dev builds: features/limits are reported but never enforced. */
|
|
62
|
+
enforced: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* `db.licenses` — install and inspect licenses from code. Available after `open()`
|
|
67
|
+
* (throws INVALID_STATE before). Mutations take effect immediately in this process.
|
|
68
|
+
* At open(), `OKDB_LICENSE_FILE` (a file holding a blob, a token, or both) is installed
|
|
69
|
+
* through the same idempotent path.
|
|
70
|
+
*/
|
|
71
|
+
export interface OKDBLicenses {
|
|
72
|
+
/** Install a license blob, an activation token (auto-detected), both whitespace-separated
|
|
73
|
+
* (`"<blob>\n<token>"`), or `{ blob, activation }`.
|
|
74
|
+
* Idempotent (re-adding a stored license → `changed:false`). Throws LICENSE_INVALID for a
|
|
75
|
+
* malformed / unsigned license, LICENSE_ACTIVATION_INVALID for a token that does not
|
|
76
|
+
* verify on this node, INVALID_INPUT for a wrong argument shape. */
|
|
77
|
+
add(input: string | { blob?: string; activation?: string }): Promise<OKDBLicenseChange>;
|
|
78
|
+
/** Apply an activation token to the stored license it names. Idempotent. */
|
|
79
|
+
activate(token: string): Promise<OKDBLicenseChange>;
|
|
80
|
+
/** Remove a stored license; resolves false when no such id. */
|
|
81
|
+
remove(id: string): Promise<boolean>;
|
|
82
|
+
list(): OKDBLicenseSummary[];
|
|
83
|
+
get(id: string): OKDBLicenseSummary | null;
|
|
84
|
+
/** What is in effect now — the active license or the free tier. */
|
|
85
|
+
effective(): OKDBEffectiveLicense;
|
|
86
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -28,6 +28,14 @@ export type { OKDBMcp, OKDBMcpTool } from './features/mcp';
|
|
|
28
28
|
export type { OKDBTimeMachine, OKDBTimeMachineDiff, OKDBTimeMachineSnapshot } from './features/time-machine';
|
|
29
29
|
export type { OKDBAdmin } from './features/admin';
|
|
30
30
|
export type { OKDBApi } from './features/api';
|
|
31
|
+
export type {
|
|
32
|
+
OKDBLicenses,
|
|
33
|
+
OKDBLicenseSummary,
|
|
34
|
+
OKDBLicenseChange,
|
|
35
|
+
OKDBEffectiveLicense,
|
|
36
|
+
OKDBLicenseFeatures,
|
|
37
|
+
OKDBLicenseLimits,
|
|
38
|
+
} from './features/licenses';
|
|
31
39
|
|
|
32
40
|
// ── Main OKDB class ───────────────────────────────────────────────────────────
|
|
33
41
|
import type {
|
|
@@ -63,6 +71,7 @@ import type { OKDBPipelines } from './features/pipelines';
|
|
|
63
71
|
import type { OKDBMcp } from './features/mcp';
|
|
64
72
|
import type { OKDBAdmin } from './features/admin';
|
|
65
73
|
import type { OKDBApi } from './features/api';
|
|
74
|
+
import type { OKDBLicenses } from './features/licenses';
|
|
66
75
|
import type { EventEmitter } from 'events';
|
|
67
76
|
|
|
68
77
|
export declare class OKDB {
|
|
@@ -91,6 +100,8 @@ export declare class OKDB {
|
|
|
91
100
|
readonly fts: OKDBFts;
|
|
92
101
|
readonly engines: OKDBEngines;
|
|
93
102
|
readonly pipelines: OKDBPipelines;
|
|
103
|
+
/** Install / list / inspect licenses from code (after open()). */
|
|
104
|
+
readonly licenses: OKDBLicenses;
|
|
94
105
|
readonly functions: OKDBFunctions;
|
|
95
106
|
readonly mcp: OKDBMcp;
|
|
96
107
|
readonly meta: unknown;
|