snow-cms 1.1.4 → 1.1.5
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/dist/index.es.js +20 -20
- package/dist/index.es5.js +1 -1
- package/package.json +2 -2
package/dist/index.es5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as z,
|
|
1
|
+
import{K as z,x as H,Y as j,j as l,y as S,z as p,B as $,C as m,E as b,U as E,Z as h,G as O,X as k,N as d,J as R,O as K,V as A,W as v,_ as x,L as f,$ as U,r as V,a0 as T,S as C,a1 as X,a2 as D,a3 as L,H as J,M as W,a4 as M}from"./index.es.js";import"./index.js";let q=a=>crypto.getRandomValues(new Uint8Array(a)),B=(a,c,n)=>{let t=(2<<Math.log(a.length-1)/Math.LN2)-1,e=-~(1.6*t*c/a.length);return(r=c)=>{let s="";for(;;){let i=n(e),o=e;for(;o--;)if(s+=a[i[o]&t]||"",s.length===r)return s}}},F=(a,c=21)=>B(a,c,q);const G=F("abcedfghicklmn",10);function y(a,c,n){const t=z(n||G());let e=!1;const r=s=>(s.record(t),s.update(c,i=>i.concat(t)),async()=>{const i=await a(s,r,()=>{s.done(t),e=!0});return e||s.done(t),()=>{s.update(c,o=>o.filter(u=>u!==t)),s.clearTimer(t),i==null||i()}});return r.timer=t,r}function P(a,c){const n=L(a),t=e=>async()=>{t.key=n,await e.wait(j);const r=c(e);return e.get(l).create(n,r),t.run=s=>e.get(l).call(a,s),()=>{e.get(l).remove(n)}};return t}function tt(a,c,n){const t=L(a);return y(async(e,r)=>{await e.wait(j);const s=await c(e);return e.get(l).create(t,s),r.run=i=>e.get(l).call(a,i),r.key=t,()=>{e.get(l).remove(t)}},H,n)}function et(a){const c=n=>async()=>{await n.wait(p);const t=a(n);return n.update($,e=>[...e,t]),c.inputRule=t,()=>{n.update($,e=>e.filter(r=>r!==t))}};return c}function at(a,c){return y(async(n,t)=>{await n.wait(p);const e=await a(n);return n.update($,r=>[...r,e]),t.inputRule=e,()=>{n.update($,r=>r.filter(s=>s!==e))}},S,c)}function I(a,c){const n=t=>async()=>{const e=c(t);return t.update(h,r=>[...r.filter(s=>s[0]!==a),[a,e]]),n.id=a,n.schema=e,()=>{t.update(h,r=>r.filter(([s])=>s!==a))}};return n.type=t=>{const e=t.get(m).marks[a];if(!e)throw b(a);return e},n}function nt(a,c,n){const t=y(async(e,r,s)=>{const i=await c(e);return e.update(h,o=>[...o.filter(u=>u[0]!==a),[a,i]]),r.id=a,r.schema=i,s(),()=>{e.update(h,o=>o.filter(([u])=>u!==a))}},E,n);return t.type=e=>{const r=e.get(m).marks[a];if(!r)throw b(a);return r},t}function Q(a,c){const n=t=>async()=>{const e=c(t);return t.update(k,r=>[...r.filter(s=>s[0]!==a),[a,e]]),n.id=a,n.schema=e,()=>{t.update(k,r=>r.filter(([s])=>s!==a))}};return n.type=t=>{const e=t.get(m).nodes[a];if(!e)throw O(a);return e},n}function rt(a,c,n){const t=y(async(e,r,s)=>{const i=await c(e);return e.update(k,o=>[...o.filter(u=>u[0]!==a),[a,i]]),r.id=a,r.schema=i,s(),()=>{e.update(k,o=>o.filter(([u])=>u!==a))}},E,n);return t.type=e=>{const r=e.get(m).nodes[a];if(!r)throw O(a);return r},t}function ct(a){let c;const n=t=>async()=>(await t.wait(p),c=a(t),t.update(d,e=>[...e,c]),()=>{t.update(d,e=>e.filter(r=>r!==c))});return n.plugin=()=>c,n.key=()=>c.spec.key,n}function st(a,c){let n;const t=y(async e=>(await e.wait(p),n=await a(e),e.update(d,r=>[...r,n]),()=>{e.update(d,r=>r.filter(s=>s!==n))}),S,c);return t.plugin=()=>n,t.key=()=>n.spec.key,t}function Y(a){const c=n=>async()=>{await n.wait(p);const t=a(n),e=R(t);return n.update(d,r=>[...r,e]),c.keymap=t,()=>{n.update(d,r=>r.filter(s=>s!==e))}};return c}function it(a,c){return y(async(n,t)=>{await n.wait(p);const e=await a(n),r=R(e);return n.update(d,s=>[...s,r]),t.keymap=e,()=>{n.update(d,s=>s.filter(i=>i!==r))}},S,c)}function ot(a,c){const n=t=>async()=>{await t.wait(p);const e=c(t);return a.type(t)instanceof A?t.update(v,r=>[...r,[a.id,e]]):t.update(x,r=>[...r,[a.id,e]]),n.view=e,n.type=a,()=>{a.type(t)instanceof A?t.update(v,r=>r.filter(s=>s[0]!==a.id)):t.update(x,r=>r.filter(s=>s[0]!==a.id))}};return n}function ut(a,c,n){return y(async(t,e)=>{await t.wait(p);const r=await c(t);return a.type(t)instanceof A?t.update(v,s=>[...s,[a.id,r]]):t.update(x,s=>[...s,[a.id,r]]),e.view=r,e.type=a,()=>{a.type(t)instanceof A?t.update(v,s=>s.filter(i=>i[0]!==a.id)):t.update(x,s=>s.filter(i=>i[0]!==a.id))}},K,n)}function g(a,c){const n=J(a,c),t=e=>(e.inject(n),()=>()=>{e.remove(n)});return t.key=n,t}function dt(a,c){const n=g(c,a),t=Q(a,r=>r.get(n.key)(r)),e=[n,t];return e.id=t.id,e.node=t,e.type=r=>t.type(r),e.schema=t.schema,e.ctx=n,e.key=n.key,e.extendSchema=r=>s=>()=>{const i=s.get(n.key),o=r(i)(s);s.update(k,u=>[...u.filter(w=>w[0]!==a),[a,o]]),e.schema=o},e}function pt(a,c){const n=g(c,a),t=I(a,r=>r.get(n.key)(r)),e=[n,t];return e.id=t.id,e.mark=t,e.type=t.type,e.schema=t.schema,e.ctx=n,e.key=n.key,e.extendSchema=r=>s=>()=>{const i=s.get(n.key),o=r(i)(s);s.update(h,u=>[...u.filter(w=>w[0]!==a),[a,o]]),e.schema=o},e}function lt(a,c){const n=Object.fromEntries(Object.entries(c).map(([s,{shortcuts:i}])=>[s,i])),t=g(n,`${a}Keymap`),e=Y(s=>{const i=s.get(t.key),o=Object.entries(c).flatMap(([u,{command:w}])=>[i[u]].flat().map(N=>[N,w(s)]));return Object.fromEntries(o)}),r=[t,e];return r.ctx=t,r.shortcuts=e,r.key=t.key,r.keymap=e.keymap,r}const ft=(a,c=()=>({}))=>g(c,`${a}Attr`),yt=(a,c=()=>({}))=>g(c,`${a}Attr`);function mt(a,c,n){const t=g(n??{},a),e=s=>async()=>{await s.wait(W);const i={plugin:c(s),options:s.get(t.key)};return s.update(M,o=>[...o,i]),()=>{s.update(M,o=>o.filter(u=>u!==i))}},r=[t,e];return r.id=a,r.plugin=e,r.options=t,r}function gt(a,c){return n=>n.get(l).call(a,c)}function wt(){return a=>{const c=a.get(f),{tr:n}=c.state,t=Object.assign(Object.create(n),n).setTime(Date.now());return c.dispatch(t)}}function ht(){return a=>{const c=document.createElement("div"),n=a.get(m),t=a.get(f),e=U.fromSchema(n).serializeFragment(t.state.doc.content);return c.appendChild(e),c.innerHTML}}function kt(){return a=>{const c=a.get(f);return a.get(V)(c.state.doc)}}function $t(a){return c=>{const n=c.get(f),t=c.get(T)(a);if(!t)return;const e=n.state.selection.content();return n.dispatch(n.state.tr.replaceSelection(new C(t.content,e.openStart,e.openEnd)).scrollIntoView())}}function At(){return a=>{const c=a.get(f),n=[];return c.state.doc.descendants(t=>{t.type.name==="heading"&&t.attrs.level&&n.push({text:t.textContent,level:t.attrs.level,id:t.attrs.id})}),n}}function vt(a,c=!1){return n=>{const t=n.get(f),e=n.get(T)(a);if(!e)return;if(!c){const{state:u}=t;return t.dispatch(u.tr.replace(0,u.doc.content.size,new C(e.content,0,0)))}const r=n.get(m),s=n.get(X),i=n.get(d),o=D.create({schema:r,doc:e,plugins:i,...s});t.updateState(o)}}function xt(a,c){return n=>{const t=n.get(f),{tr:e}=t.state,r=e.doc.nodeAt(a);if(!r)return;const s=c(r.attrs);return t.dispatch(e.setNodeMarkup(a,void 0,s))}}const St=(...a)=>{const c=a.length;let n=c;for(;n--;)if(typeof a[n]!="function")throw new TypeError("Expected a function");return(...t)=>{let e=0,r=c?a[e](...t):t[0];for(;++e<c;)r=a[e](r);return r}};export{P as $command,tt as $commandAsync,g as $ctx,et as $inputRule,at as $inputRuleAsync,I as $mark,nt as $markAsync,yt as $markAttr,pt as $markSchema,Q as $node,rt as $nodeAsync,ft as $nodeAttr,dt as $nodeSchema,ct as $prose,st as $proseAsync,mt as $remark,Y as $shortcut,it as $shortcutAsync,lt as $useKeymap,ot as $view,ut as $viewAsync,y as addTimer,gt as callCommand,wt as forceUpdate,ht as getHTML,kt as getMarkdown,$t as insert,G as nanoid,At as outline,St as pipe,vt as replaceAll,xt as setAttr};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-cms",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "A configurable CMS built with Svelte.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Sammy-T",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"pouchdb-core": "^9.0.0",
|
|
40
40
|
"pouchdb-find": "^9.0.0",
|
|
41
41
|
"svelte": "^4.2.19",
|
|
42
|
-
"vite": "^5.4.
|
|
42
|
+
"vite": "^5.4.8"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "run-p build:watch:cms serve:site",
|