dev-process-kit 0.3.2 → 0.4.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/dist/boards.js +1 -1
- package/dist/chunks/{shared-BPVvO01I.js → shared-B2S6Vsb5.js} +20 -20
- package/dist/chunks/{shared-DPD_tBh8.js → shared-BBKduY__.js} +1 -1
- package/dist/chunks/{shared-BblP0eEY.js → shared-BDAaq_FM.js} +1 -1
- package/dist/chunks/{shared-DlZJHHpN.js → shared-BWIla41c.js} +367 -317
- package/dist/chunks/{shared-Cbm3cQ8l.js → shared-Bj6Oqtla.js} +62 -62
- package/dist/chunks/shared-CBzul9Ae.js +1 -0
- package/dist/chunks/shared-CJZKj_HI.js +3 -0
- package/dist/chunks/{shared-bP-1q7ZQ.js → shared-CKIn5p8J.js} +11 -11
- package/dist/chunks/shared-CTxoriaS.js +1 -0
- package/dist/chunks/shared-Cd0_rxlc.js +1883 -0
- package/dist/chunks/{shared-BBTySCXK.js → shared-CkOyWfwZ.js} +13 -13
- package/dist/chunks/{shared-nrgnwzCU.js → shared-DF9b2Hdv.js} +2 -2
- package/dist/chunks/{shared-C5wXNKl3.js → shared-DRCtnrZO.js} +1 -1
- package/dist/chunks/{shared-Bu1HuBxn.js → shared-DZNeJT2R.js} +22 -22
- package/dist/chunks/{shared-7Yki1uKI.js → shared-DnSwEx91.js} +37 -37
- package/dist/chunks/{shared-C4EqS9Lp.js → shared-O0o2ls6e.js} +16 -16
- package/dist/chunks/{shared-bQPXht-t.js → shared-lPeFJij5.js} +2 -2
- package/dist/chunks/{shared-UH4xqvj9.js → shared-zNs0yAfd.js} +139 -135
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sync.js +1 -0
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +2 -1
- package/dist/chunks/shared-C44CU0VV.js +0 -1868
- package/dist/chunks/shared-hhwSHdS3.js +0 -1
- package/dist/chunks/shared-pYjptMZ1.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a5 as r}from"./shared-BWIla41c.js";const t=o=>o??r;export{t as o};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const ve={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function A(n){return ve}let me;function de(n){return me?.get(n)}let ke;function be(n){return ke?.get(n)}let ge;function xe(n,t){return ge?.get(n)?.get(t)}function S(n){const t=typeof n;return t==="string"?`"${n}"`:t==="number"||t==="bigint"||t==="boolean"?`${n}`:t==="object"||t==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":t}function l(n,t,e,r,i){const s=i&&"input"in i?i.input:e.value,u=i?.expected??n.expects??null,c=i?.received??S(s),o={kind:n.kind,type:n.type,input:s,expected:u,received:c,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${c}`,requirement:n.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},a=n.kind==="schema",p=i?.message??n.message??xe(n.reference,o.lang)??(a?be(o.lang):null)??r.message??de(o.lang);p!==void 0&&(o.message=typeof p=="function"?p(o):p),a&&(e.typed=!1),e.issues?e.issues.push(o):e.issues=[o]}function Se(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function Ee(n,t){return Object.prototype.hasOwnProperty.call(n,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function I(n,t){const e=[...new Set(n)];return e.length>1?`(${e.join(` ${t} `)})`:e[0]??"never"}function f(n){return n["~standard"]={version:1,vendor:"valibot",validate:t=>n["~run"]({value:t},A())},n}function _e(n){if(n.path){let t="";for(const e of n.path)if(typeof e.key=="string"||typeof e.key=="number")t?t+=`.${e.key}`:t+=e.key;else return null;return t}return null}var Oe=class extends Error{constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};const je=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,De=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function M(n,t){return{kind:"validation",type:"check",reference:M,async:!1,expects:null,requirement:n,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&l(this,"input",e,r),e}}}function F(n){return{kind:"validation",type:"finite",reference:F,async:!1,expects:null,requirement:Number.isFinite,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&l(this,"finite",t,e),t}}}function U(n,t){const e=S(n);return{kind:"validation",type:"includes",reference:U,async:!1,expects:e,requirement:n,message:t,"~run"(r,i){return r.typed&&!r.value.includes(this.requirement)&&l(this,"content",r,i,{received:`!${e}`}),r}}}function C(n){return{kind:"validation",type:"integer",reference:C,async:!1,expects:null,requirement:Number.isInteger,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&l(this,"integer",t,e),t}}}function G(n){return{kind:"validation",type:"iso_date",reference:G,async:!1,expects:null,requirement:je,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&l(this,"date",t,e),t}}}function z(n){return{kind:"validation",type:"iso_timestamp",reference:z,async:!1,expects:null,requirement:De,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&l(this,"timestamp",t,e),t}}}function v(n,t){return{kind:"validation",type:"min_length",reference:v,async:!1,expects:`>=${n}`,requirement:n,message:t,"~run"(e,r){return e.typed&&e.value.length<this.requirement&&l(this,"length",e,r,{received:`${e.value.length}`}),e}}}function J(n,t){return{kind:"validation",type:"min_value",reference:J,async:!1,expects:`>=${n instanceof Date?n.toJSON():S(n)}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!(e.value>=this.requirement)&&l(this,"value",e,r,{received:e.value instanceof Date?e.value.toJSON():S(e.value)}),e}}}function P(n,t){return{kind:"validation",type:"regex",reference:P,async:!1,expects:`${n}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&l(this,"format",e,r),e}}}function Y(n){return{kind:"validation",type:"safe_integer",reference:Y,async:!1,expects:null,requirement:Number.isSafeInteger,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&l(this,"safe integer",t,e),t}}}function Z(){return{kind:"transformation",type:"trim",reference:Z,async:!1,"~run"(n){return n.value=n.value.trim(),n}}}function X(n){return{kind:"validation",type:"url",reference:X,async:!1,expects:null,requirement(t){try{return URL.canParse?URL.canParse(t):(new URL(t),!0)}catch{return!1}},message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&l(this,"URL",t,e),t}}}const B={abortEarly:!0};function q(n,t,e){return typeof n.fallback=="function"?n.fallback(t,e):n.fallback}function Q(n,t){return f({...n,fallback:t,"~run"(e,r){const i=n["~run"](e,r);return i.issues?{typed:!0,value:q(this,i,r)}:i}})}function N(n,t,e){return typeof n.default=="function"?n.default(t,e):n.default}function Ne(n,t){return!n["~run"]({value:t},B).issues}function H(){return f({kind:"schema",type:"any",reference:H,expects:"any",async:!1,"~run"(n){return n.typed=!0,n}})}function w(n,t){return f({kind:"schema",type:"array",reference:w,expects:"Array",async:!1,item:n,message:t,"~run"(e,r){const i=e.value;if(Array.isArray(i)){e.typed=!0,e.value=[];for(let s=0;s<i.length;s++){const u=i[s],c=this.item["~run"]({value:u},r);if(c.issues){const o={type:"array",origin:"value",input:i,key:s,value:u};for(const a of c.issues)a.path?a.path.unshift(o):a.path=[o],e.issues?.push(a);if(e.issues||(e.issues=c.issues),r.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else l(this,"type",e,r);return e}})}function W(n){return f({kind:"schema",type:"boolean",reference:W,expects:"boolean",async:!1,message:n,"~run"(t,e){return typeof t.value=="boolean"?t.typed=!0:l(this,"type",t,e),t}})}function _(n,t){return f({kind:"schema",type:"exact_optional",reference:_,expects:n.expects,async:!1,wrapped:n,default:t,"~run"(e,r){return this.wrapped["~run"](e,r)}})}function ee(n){return f({kind:"schema",type:"function",reference:ee,expects:"Function",async:!1,message:n,"~run"(t,e){return typeof t.value=="function"?t.typed=!0:l(this,"type",t,e),t}})}function ne(n){return f({kind:"schema",type:"lazy",reference:ne,expects:"unknown",async:!1,getter:n,"~run"(t,e){return this.getter(t.value)["~run"](t,e)}})}function b(n,t){return f({kind:"schema",type:"literal",reference:b,expects:S(n),async:!1,literal:n,message:t,"~run"(e,r){return Se(e.value,this.literal)?e.typed=!0:l(this,"type",e,r),e}})}function te(n){return f({kind:"schema",type:"null",reference:te,expects:"null",async:!1,message:n,"~run"(t,e){return t.value===null?t.typed=!0:l(this,"type",t,e),t}})}function re(n,t){return f({kind:"schema",type:"nullable",reference:re,expects:`(${n.expects} | null)`,async:!1,wrapped:n,default:t,"~run"(e,r){return e.value===null&&(this.default!==void 0&&(e.value=N(this,e,r)),e.value===null)?(e.typed=!0,e):this.wrapped["~run"](e,r)}})}function se(n){return f({kind:"schema",type:"number",reference:se,expects:"number",async:!1,message:n,"~run"(t,e){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:l(this,"type",t,e),t}})}function h(n,t){return f({kind:"schema",type:"object",reference:h,expects:"Object",async:!1,entries:n,message:t,"~run"(e,r){const i=e.value;if(i&&typeof i=="object"){e.typed=!0,e.value={};for(const s in this.entries){const u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const c=s in i?i[s]:N(u),o=u["~run"]({value:c},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:c};for(const p of o.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=o.issues),r.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[s]=o.value}else if(u.fallback!==void 0)e.value[s]=q(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(l(this,"key",e,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else l(this,"type",e,r);return e}})}function T(n,t){return f({kind:"schema",type:"optional",reference:T,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,default:t,"~run"(e,r){return e.value===void 0&&(this.default!==void 0&&(e.value=N(this,e,r)),e.value===void 0)?(e.typed=!0,e):this.wrapped["~run"](e,r)}})}function ie(n,t){return f({kind:"schema",type:"picklist",reference:ie,expects:I(n.map(S),"|"),async:!1,options:n,message:t,"~run"(e,r){return this.options.includes(e.value)?e.typed=!0:l(this,"type",e,r),e}})}function ue(n,t,e){return f({kind:"schema",type:"record",reference:ue,expects:"Object",async:!1,key:n,value:t,message:e,"~run"(r,i){const s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(const u in s)if(Ee(s,u)){const c=s[u],o=this.key["~run"]({value:u},i);if(o.issues){const p={type:"object",origin:"key",input:s,key:u,value:c};for(const k of o.issues)k.path=[p],r.issues?.push(k);if(r.issues||(r.issues=o.issues),i.abortEarly){r.typed=!1;break}}const a=this.value["~run"]({value:c},i);if(a.issues){const p={type:"object",origin:"value",input:s,key:u,value:c};for(const k of a.issues)k.path?k.path.unshift(p):k.path=[p],r.issues?.push(k);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}(!o.typed||!a.typed)&&(r.typed=!1),o.typed&&(r.value[o.value]=a.value)}}else l(this,"type",r,i);return r}})}function oe(n,t){return f({kind:"schema",type:"strict_object",reference:oe,expects:"Object",async:!1,entries:n,message:t,"~run"(e,r){const i=e.value;if(i&&typeof i=="object"){e.typed=!0,e.value={};for(const s in this.entries){const u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const c=s in i?i[s]:N(u),o=u["~run"]({value:c},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:c};for(const p of o.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=o.issues),r.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[s]=o.value}else if(u.fallback!==void 0)e.value[s]=q(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(l(this,"key",e,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}if(!e.issues||!r.abortEarly){for(const s in i)if(!Object.prototype.hasOwnProperty.call(this.entries,s)){l(this,"key",e,r,{input:s,expected:"never",path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]});break}}}else l(this,"type",e,r);return e}})}function y(n){return f({kind:"schema",type:"string",reference:y,expects:"string",async:!1,message:n,"~run"(t,e){return typeof t.value=="string"?t.typed=!0:l(this,"type",t,e),t}})}function ce(n){let t;if(n)for(const e of n)if(t)for(const r of e.issues)t.push(r);else t=e.issues;return t}function le(n,t){return f({kind:"schema",type:"union",reference:le,expects:I(n.map(e=>e.expects),"|"),async:!1,options:n,message:t,"~run"(e,r){let i,s,u;for(const c of this.options){const o=c["~run"]({value:e.value},r);if(o.typed)if(o.issues)s?s.push(o):s=[o];else{i=o;break}else u?u.push(o):u=[o]}if(i)return i;if(s){if(s.length===1)return s[0];l(this,"type",e,r,{issues:ce(s)}),e.typed=!0}else{if(u?.length===1)return u[0];l(this,"type",e,r,{issues:ce(u)})}return e}})}function E(){return f({kind:"schema",type:"unknown",reference:E,expects:"unknown",async:!1,"~run"(n){return n.typed=!0,n}})}function O(n,t,e){return f({kind:"schema",type:"variant",reference:O,expects:"Object",async:!1,key:n,options:t,message:e,"~run"(r,i){const s=r.value;if(s&&typeof s=="object"){let u,c=0,o=this.key,a=[];const p=(k,$)=>{for(const x of k.options){if(x.type==="variant")p(x,new Set($).add(x.key));else{let K=!0,j=0;for(const d of $){const D=x.entries[d];if(d in s?D["~run"]({typed:!1,value:s[d]},B).issues:D.type!=="exact_optional"&&D.type!=="optional"&&D.type!=="nullish"){K=!1,o!==d&&(c<j||c===j&&d in s&&!(o in s))&&(c=j,o=d,a=[]),o===d&&a.push(x.entries[d].expects);break}j++}if(K){const d=x["~run"]({value:s},i);(!u||!u.typed&&d.typed)&&(u=d)}}if(u&&!u.issues)break}};if(p(this,new Set([this.key])),u)return u;l(this,"type",r,i,{input:s[o],expected:I(a,"|"),path:[{type:"object",origin:"value",input:s,key:o,value:s[o]}]})}else l(this,"type",r,i);return r}})}function we(n,t,e){const r=n["~run"]({value:t},A());if(r.issues)throw new Oe(r.issues);return r.value}function m(...n){return f({...n[0],pipe:n,"~run"(t,e){for(const r of n)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!e.abortEarly&&!e.abortPipeEarly)&&(t=r["~run"](t,e))}return t}})}function g(n,t,e){const r=n["~run"]({value:t},A());return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function Ae(n){let t="";for(const e of n){t&&(t+=`
|
|
2
|
+
`),t+=`\xD7 ${e.message}`;const r=_e(e);r&&(t+=`
|
|
3
|
+
\u2192 at ${r}`)}return t}const R=h({type:m(y(),v(1)),id:m(y(),v(1))}),Ie=m(y(),v(1),P(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Pe=(n,t)=>{if(t===1)return n.includes(".")?null:[n];const e=n.split(".");return e.length===t&&e.every(r=>r.length>0)?e:null},L=h({id:m(y(),v(1)),type:m(y(),v(1)),target:R,payload:E(),note:_(y()),createdAt:m(y(),v(1))}),qe=(n,t,e,r={})=>{const i=h({id:m(y(),v(1)),type:b(n),target:R,payload:e,note:_(y()),createdAt:m(y(),v(1))}),s=u=>{const c=g(L,u);if(!c.success||c.output.type!==n)return null;const o=g(e,u.payload);return o.success?{id:c.output.id,type:n,target:c.output.target,payload:o.output,...c.output.note===void 0?{}:{note:c.output.note},createdAt:c.output.createdAt}:null};return{schema:i,mode:r.mode??"patch",targetType:t,actionType:n,payloadSchema:e,parse:s,...r.dedupeKey?{dedupeKey:r.dedupeKey}:{}}},Te=(n,t)=>{const e=ae(n,t.type);if(e===void 0)return null;const r=e.parse(t);return r===null?null:r},Re=(n,t)=>{const e=g(n.payloadSchema,t.payload);if(!e.success)throw new Error(`invalid payload for action "${t.type}"`);return e.output},ae=(n,t)=>Object.hasOwn(n,t)?n[t]:void 0,Le=n=>{throw new Error(`unhandled action: ${JSON.stringify(n)}`)},Ve=h({id:m(y(),v(1))}),$e=n=>{const t=g(Ve,n.payload);return`${n.type}|${t.success?t.output.id:JSON.stringify(n.payload)}`},Ke="dpk-sync-request",Me=1,Fe=(n,t)=>pe(n)===pe(t),pe=n=>{switch(n.kind){case"append":return`append:${n.action.id}`;case"remove":return`remove:${n.id}`;case"clear":return`clear:${n.upTo}`}},Ue=h({id:m(y(),v(1)),name:_(y())}),V=y(),Ce=m(y(),v(1)),Ge=h({kind:b("snapshot"),cursor:V,actions:w(E())}),ze=h({kind:b("ops"),cursor:V,ops:w(E())}),Je=O("kind",[Ge,ze]),Ye=h({kind:b("append"),action:E()}),fe=h({kind:b("remove"),id:Ce}),ye=h({kind:b("clear"),upTo:V}),Ze=O("kind",[Ye,fe,ye]),Xe=O("kind",[h({kind:b("append"),action:L}),fe,ye]),Be=h({author:Q(T(Ue),void 0)}),Qe=(n,t)=>{const e=g(Je,n);if(!e.success)return null;const r=e.output;return r.kind==="snapshot"?{kind:"snapshot",cursor:r.cursor,entries:r.actions.flatMap(i=>{const s=he(i,t);return s===null?[]:[s]})}:{kind:"ops",cursor:r.cursor,ops:r.ops.flatMap(i=>{const s=g(Ze,i);if(!s.success)return[];if(s.output.kind!=="append")return[s.output];const u=he(s.output.action,t);return u===null?[]:[{kind:"append",entry:u}]})}},he=(n,t)=>{const e=t(n);if(e===null)return null;const r=g(Be,n);return{action:e,author:r.success?r.output.author:void 0}},He=n=>Array.isArray(n)?n.flatMap(t=>{const e=g(Xe,t);return e.success?[e.output]:[]}):[];export{le as A,_ as B,Ie as C,re as D,J as E,C as F,ne as G,F as H,Q as I,ue as J,P as K,M as L,z as M,Pe as N,Ne as O,G as P,X as Q,te as R,Me as S,Y as T,Ae as U,U as V,ae as W,Fe as X,Qe as Y,H as Z,Ke as a,Le as b,L as c,qe as d,$e as e,Re as f,W as g,w as h,ee as i,y as j,T as k,b as l,we as m,se as n,h as o,Te as p,oe as q,He as r,g as s,R as t,E as u,m as v,v as w,ie as x,Z as y,O as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A as v,aY as O,t as j,a4 as R}from"./shared-BWIla41c.js";import{L as D}from"./shared-CjW1DhGL.js";const N=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]],K=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],P=z(class extends C{constructor(){super(...arguments),this.key=d}render(e,r){return this.key=e,r}update(e,[r,t]){return r!==this.key&&(L(e),this.key=r),t}}),U=B({en:{comment:"Comment",commentOn:e=>`Comment on ${e}`,submit:"Add",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:e=>`${e}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u8FFD\u52A0",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),F=(e,r,t={})=>({body:e,notes:r,submission:e.trim()||null,label:t.label??null,error:t.error??null,key:t.key??null,choice:t.choice??null,submitLabel:t.submitLabel??null}),G=(e,r,t)=>{const a=()=>{r.submission!==null&&t({kind:"comment",body:r.submission})};return n`<div
|
|
2
2
|
class="comment-pop"
|
|
3
3
|
popover="manual"
|
|
4
4
|
role="dialog"
|
|
@@ -8,7 +8,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
8
8
|
>
|
|
9
9
|
${r.label?n`<strong class="comment-target">${r.label}</strong>`:d}
|
|
10
10
|
${r.error?n`<p class="comment-error" role="alert">${r.error}</p>`:d}
|
|
11
|
-
${r.choice?
|
|
11
|
+
${r.choice?H(r.choice,t):d}
|
|
12
12
|
${r.notes.length?n`<ul class="comment-list">
|
|
13
13
|
${r.notes.map(o=>n`<li>${o}</li>`)}
|
|
14
14
|
</ul>`:d}
|
|
@@ -33,7 +33,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
33
33
|
${e.cancel}
|
|
34
34
|
</button>
|
|
35
35
|
</div>
|
|
36
|
-
</div>`},
|
|
36
|
+
</div>`},H=(e,r)=>{const t=e.options.find(a=>a.value===e.value)?.hint;return n`<fieldset class="comment-kinds">
|
|
37
37
|
<legend>${e.label}</legend>
|
|
38
38
|
${e.options.map(a=>n`<label class="comment-kind">
|
|
39
39
|
<input
|
|
@@ -46,7 +46,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
46
46
|
<span>${a.label}</span>
|
|
47
47
|
</label>`)}
|
|
48
48
|
</fieldset>
|
|
49
|
-
${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},$=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},
|
|
49
|
+
${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},$=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},S=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,W=(e,r)=>{const t=e.trim();return t.startsWith("/")?$(t,r)?.href??t:/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`},X=e=>{try{return new URL(e).host||e}catch{return e}},_=p(E),V=p(M),J=p(K),Y=p(D),g=p(N),q=(e,r,t)=>{const a=r.length-1;if(e==="ArrowRight")return r[t===a?0:t+1];if(e==="ArrowLeft")return r[t===0?a:t-1];if(e==="Home")return r[0];if(e==="End")return r[a]},Q=e=>{const{view:r,send:t,labels:a}=e,o=s=>i=>{const l=r.tabs[s],k=i.key==="Enter"||i.key===" "?l:q(i.key,r.tabs,s);k!==void 0&&(i.preventDefault(),t({kind:"activate",id:k.id,focus:!0}))};return n`<div class="browser-tabs">
|
|
50
50
|
<div class="browser-tab-list" role="tablist" aria-label=${a.tabs}>
|
|
51
51
|
${r.tabs.map((s,i)=>n`<div
|
|
52
52
|
class="browser-tab"
|
|
@@ -57,7 +57,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
57
57
|
@click=${()=>t({kind:"activate",id:s.id})}
|
|
58
58
|
@keydown=${o(i)}
|
|
59
59
|
>
|
|
60
|
-
<span class="browser-favicon">${
|
|
60
|
+
<span class="browser-favicon">${g()}</span>
|
|
61
61
|
<span class="browser-tab-title">${s.title}</span>
|
|
62
62
|
${y(e,s.id)}
|
|
63
63
|
</div>`)}
|
|
@@ -80,7 +80,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
80
80
|
@click=${t=>{t.stopPropagation(),e.send({kind:"close-tab",id:r})}}
|
|
81
81
|
>
|
|
82
82
|
${j()}
|
|
83
|
-
</button>`,Z={back:_,forward:
|
|
83
|
+
</button>`,Z={back:_,forward:V,reload:J},c=(e,r)=>{const{view:t,send:a,labels:o}=e,s=o[r],i={back:!t.canBack,forward:!t.canForward,reload:t.entry?.kind!=="page"}[r];return n`<button
|
|
84
84
|
class=${`browser-nav browser-${r}`}
|
|
85
85
|
type="button"
|
|
86
86
|
aria-label=${s}
|
|
@@ -92,7 +92,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
92
92
|
</button>`},ee=e=>{const{view:r,send:t,labels:a,phone:o}=e,s=r.profile??a.guest;return n`<div class="browser-toolbar">
|
|
93
93
|
${o?d:n`${c(e,"back")} ${c(e,"forward")} ${c(e,"reload")}`}
|
|
94
94
|
<div class="browser-address-form">
|
|
95
|
-
<span class="browser-lock">${r.entry?.kind==="page"?
|
|
95
|
+
<span class="browser-lock">${r.entry?.kind==="page"?Y():g()}</span>
|
|
96
96
|
<input
|
|
97
97
|
class="browser-address"
|
|
98
98
|
type="text"
|
|
@@ -109,7 +109,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
109
109
|
<span class="browser-avatar" aria-hidden="true">${Array.from(s)[0]??""}</span>
|
|
110
110
|
${o?d:n`<span class="browser-profile-name">${s}</span>`}
|
|
111
111
|
</span>
|
|
112
|
-
</div>`},re=e=>n`${e.phone?d:
|
|
112
|
+
</div>`},re=e=>n`${e.phone?d:Q(e)} ${ee(e)}
|
|
113
113
|
<div class="browser-progress" aria-hidden="true"></div>`,te=e=>{if(!e.phone)return d;const{view:r,send:t,labels:a}=e;return n`<div class="browser-bottom">
|
|
114
114
|
${c(e,"back")} ${c(e,"forward")}
|
|
115
115
|
<button
|
|
@@ -135,7 +135,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
135
135
|
</div>`},ae=e=>{const{view:r,send:t,labels:a}=e;return n`<div class="browser-switcher" role="dialog" aria-label=${a.tabs}>
|
|
136
136
|
${r.tabs.map(o=>n`<div class="browser-card" aria-current=${o.active?"true":d}>
|
|
137
137
|
<button class="browser-card-open" type="button" @click=${()=>t({kind:"activate",id:o.id})}>
|
|
138
|
-
<span class="browser-favicon">${
|
|
138
|
+
<span class="browser-favicon">${g()}</span>
|
|
139
139
|
<span class="browser-card-title">${o.title}</span>
|
|
140
140
|
<span class="browser-card-url">${o.url}</span>
|
|
141
141
|
</button>
|
|
@@ -159,7 +159,7 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
159
159
|
<p>${e.unreachableBody}</p>
|
|
160
160
|
<code>${r}</code>
|
|
161
161
|
</div>`,ne=(e,r)=>{const t=e.view.entry;return n`${e.phone&&e.switcher?ae(e):d}
|
|
162
|
-
${t?.kind==="unreachable"?se(e.labels,t.url):r===void 0?oe(e):r}`},
|
|
162
|
+
${t?.kind==="unreachable"?se(e.labels,t.url):r===void 0?oe(e):r}`},b=e=>JSON.stringify(Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[t])=>r<t?-1:r>t?1:0)),m=(e,r)=>e?.kind==="page"&&b(e.page)===r,w=e=>`tab-${e}`,ie=e=>({tabs:[{id:w(1),history:[{kind:"page",page:e}],index:0}],activeId:w(1),seen:b(e),nextId:2}),de={id:"",history:[],index:0},u=e=>e.tabs.find(r=>r.id===e.activeId)??e.tabs[0]??de,x=e=>{const r=u(e);return r.history[r.index]},le=e=>u(e).index>0,ce=e=>{const r=u(e);return r.index<r.history.length-1},T=(e,r)=>({...e,tabs:e.tabs.map(t=>t.id===e.activeId?r(t):t)}),h=(e,r)=>T(e,t=>({...t,history:[...t.history.slice(0,t.index+1),r],index:t.index+1})),f=e=>{const r=x(e);return r?.kind==="page"?{...e,seen:b(r.page)}:e},I=(e,r)=>{const t=u(e),a=t.index+r;return a<0||a>=t.history.length?e:f(T(e,o=>({...o,index:a})))},A=(e,r,t)=>{const a=w(e.nextId),o=e.tabs.findIndex(s=>s.id===e.activeId)+1;return f({...e,tabs:[...e.tabs.slice(0,o),{id:a,history:[r],index:0},...e.tabs.slice(o)],activeId:t?e.activeId:a,nextId:e.nextId+1})},pe=(e,r)=>{const t=e.tabs.findIndex(s=>s.id===r);if(t<0)return e;if(e.tabs.length===1){const s=w(e.nextId);return{...e,tabs:[{id:s,history:[{kind:"new-tab"}],index:0}],activeId:s,nextId:e.nextId+1}}const a=e.tabs.filter(s=>s.id!==r);if(r!==e.activeId)return{...e,tabs:a};const o=a[t]??a[t-1];return f({...e,tabs:a,activeId:o?.id??e.activeId})},be=(e,r)=>{const t=r===null?null:b(r);if(t===e.seen)return e;const a={...e,seen:t};return r===null||t===null||m(x(e),t)?a:h(a,{kind:"page",page:r})},ue=(e,r)=>{const t=b(r);return m(x(e),t)?e.seen===t?e:{...e,seen:t}:h({...e,seen:t},{kind:"page",page:r})},we=(e,r)=>{switch(r.kind){case"observe":return be(e,r.page);case"visit":return ue(e,r.page);case"back":return I(e,-1);case"forward":return I(e,1);case"open-tab":return A(e,r.entry,r.background);case"new-tab":return A(e,{kind:"new-tab"},!1);case"unreachable":return h(e,{kind:"unreachable",url:r.url});case"activate":return e.tabs.some(t=>t.id===r.id)&&r.id!==e.activeId?f({...e,activeId:r.id}):e;case"close-tab":return pe(e,r.id);default:return e}},xe=R`
|
|
163
163
|
/*
|
|
164
164
|
* A tab strip on a darker band, the active tab merged into the toolbar below
|
|
165
165
|
* it, round navigation buttons, a pill address bar and the profile of the
|
|
@@ -683,4 +683,4 @@ import{bs as z,bt as C,ai as d,bu as L,a5 as B,as as n,b0 as b,bv as E,bw as M,H
|
|
|
683
683
|
top: 8px;
|
|
684
684
|
right: 8px;
|
|
685
685
|
}
|
|
686
|
-
`;export{$ as a,
|
|
686
|
+
`;export{$ as a,S as b,U as c,u as d,ce as e,le as f,xe as g,X as h,P as i,x as j,re as k,ne as l,te as m,we as n,F as p,G as r,ie as s,W as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as S,L as T,V as _}from"./shared-BWIla41c.js";import{m as j,q as a,k as o,h as k,j as l,C as B,v as E,w as $}from"./shared-CJZKj_HI.js";const r=S({en:{wholePage:"Whole page",sectionGroup:"Section"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",sectionGroup:"\u30BB\u30AF\u30B7\u30E7\u30F3"}}),x=a({id:B,title:E(l(),$(1))}),c=a({title:o(l(),""),sections:o(k(x),[])}),p=t=>{const e=j(c,t),i=new Set;for(const n of e.sections){if(i.has(n.id))throw new Error(`duplicate section id: ${n.id}`);i.add(n.id)}return{title:e.title,sections:e.sections}},d=()=>({title:"",sections:[]}),s=(t,e)=>t.sections.find(i=>i.id===e),m=t=>t.title===""?"Plain":t.title,u=(t,e,i)=>{switch(i.type){case"section":return s(e,i.id)?.title??i.id;case"page":return t.wholePage;default:return i.id}},g=(t,e,i)=>({title:e.type,targetLabel:u(t,i,e.target),tone:"meta"}),f=t=>`${t.type} ${T(t.target)} ${JSON.stringify(t.payload)}`,h=(t,e)=>e.sections.map(i=>({value:`section:${i.id}`,label:i.title,group:t.sectionGroup})),w=(t,e)=>e,y=(t,e)=>{switch(e.type){case"section":return s(t,e.id)!==void 0;case"page":return!0;default:return!1}},P=t=>{const e=r(t);return{kind:"view",name:"plain",label:"Plain",addable:!1,parseBase:p,emptyBase:d,actions:{},apply:()=>null,hasTarget:y,describe:(i,n)=>g(e,i,n),serialize:f,resolveNavigation:w,commentTargets:i=>h(e,i),title:m}};class b extends _{definitionFor(e){return P(e)}renderRegions(e){return{}}}const v=()=>{customElements.get("dpk-view-plain")||customElements.define("dpk-view-plain",b)},L=Object.freeze(Object.defineProperty({__proto__:null,DpkViewPlain:b,definePlainElement:v,describePlainAction:g,emptyPlainBase:d,findSection:s,parsePlainBase:p,plainBaseSchema:c,plainCommentTargets:h,plainDefinitionFor:P,plainHasTarget:y,plainMessages:r,plainTargetLabel:u,plainTitle:m,resolvePlainNavigation:w,serializePlainAction:f},Symbol.toStringTag,{value:"Module"}));export{v as d,L as i};
|