@ni/ok-components 0.2.7 → 0.2.9
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/all-components-bundle.js +439 -357
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +37 -14
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/icon-dynamic/index.d.ts +23 -0
- package/dist/esm/icon-dynamic/index.js +59 -0
- package/dist/esm/icon-dynamic/index.js.map +1 -0
- package/dist/esm/icon-dynamic/styles.d.ts +1 -0
- package/dist/esm/icon-dynamic/styles.js +20 -0
- package/dist/esm/icon-dynamic/styles.js.map +1 -0
- package/dist/esm/icon-dynamic/template.d.ts +2 -0
- package/dist/esm/icon-dynamic/template.js +3 -0
- package/dist/esm/icon-dynamic/template.js.map +1 -0
- package/dist/esm/utilities/style/user-select.d.ts +5 -0
- package/dist/esm/utilities/style/user-select.js +10 -0
- package/dist/esm/utilities/style/user-select.js.map +1 -0
- package/package.json +3 -3
|
@@ -6937,11 +6937,11 @@ let e=this.pendingRecords()
|
|
|
6937
6937
|
e.length&&(this.queue=[])
|
|
6938
6938
|
let n=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&uk(t)&&!this.ignoreSelectionChange(n),o=-1,s=-1,r=!1,a=[]
|
|
6939
6939
|
if(t.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],a)
|
|
6940
|
-
n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(r=!0))}if(eC&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
|
|
6940
|
+
n&&(o=o<0?n.from:Math.min(n.from,o),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(r=!0))}if(!a.some((t=>"BR"==t.nodeName))||8!=t.input.lastKeyCode&&46!=t.input.lastKeyCode){if(eC&&a.length){let e=a.filter((t=>"BR"==t.nodeName))
|
|
6941
6941
|
if(2==e.length){let[t,n]=e
|
|
6942
6942
|
t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection
|
|
6943
6943
|
for(let i of e){let e=i.parentNode
|
|
6944
|
-
!e||"LI"!=e.nodeName||n&&PS(t,n)==e||i.remove()}}}else
|
|
6944
|
+
!e||"LI"!=e.nodeName||n&&PS(t,n)==e||i.remove()}}}}else for(let t of a)if("BR"==t.nodeName&&t.parentNode){let e=t.nextSibling
|
|
6945
6945
|
e&&1==e.nodeType&&"false"==e.contentEditable&&t.parentNode.removeChild(t)}let l=null
|
|
6946
6946
|
o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&jx(n)&&(l=nk(t))&&l.eq(Uw.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ok(t),this.currentSelection.set(n),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),function(t){if(NS.has(t))return
|
|
6947
6947
|
if(NS.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=eC,LS)return
|
|
@@ -9147,7 +9147,7 @@ this.inTightList=i,t.forEach(((o,s,r)=>{r&&i&&this.flushClose(1),this.wrapBlock(
|
|
|
9147
9147
|
return e[0]+t+e[1]}repeat(t,e){let n=""
|
|
9148
9148
|
for(let i=0;i<e;i++)n+=t
|
|
9149
9149
|
return n}markString(t,e,n,i){let o=this.getMark(t.type.name),s=e?o.open:o.close
|
|
9150
|
-
return"string"==typeof s?s:s(this,t,n,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,e,n){for(;;e++){if(e
|
|
9150
|
+
return"string"==typeof s?s:s(this,t,n,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,e,n){for(;;e++){if(e>=t.childCount)return!1
|
|
9151
9151
|
let i=t.child(e)
|
|
9152
9152
|
if(i.type.name!=this.options.hardBreakNodeName)return n.isInSet(i.marks)
|
|
9153
9153
|
e++}}}var OT
|
|
@@ -9323,10 +9323,10 @@ return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme
|
|
|
9323
9323
|
e&&n.push(e)})),!t||t.replace(iR,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var sR=MM.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((t=>{"string"!=typeof t?YO(t.scheme,t.optionalSlashes):YO(t)}))},onDestroy(){wD.groups={},KO.scanner=null,KO.parser=null,KO.tokenQueue=[],KO.pluginQueue=[],KO.customSchemes=[],KO.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!oR(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t)
|
|
9324
9324
|
if(e||n&&!t.includes("@"))return!0
|
|
9325
9325
|
const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0]
|
|
9326
|
-
return!/^\d{1,3}(\.\d{1,3}){3}$/.test(i)&&!!/\./.test(i)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href")
|
|
9327
|
-
return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",A$(this.options.HTMLAttributes,t),0]:["a",A$(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n
|
|
9328
|
-
const i=
|
|
9329
|
-
return
|
|
9326
|
+
return!/^\d{1,3}(\.\d{1,3}){3}$/.test(i)&&!!/\./.test(i)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href")
|
|
9327
|
+
return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",A$(this.options.HTMLAttributes,t),0]:["a",A$(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,i,o,s
|
|
9328
|
+
const r=null!=(i=null==(n=t.attrs)?void 0:n.href)?i:"",a=null!=(s=null==(o=t.attrs)?void 0:o.title)?s:"",l=e.renderChildren(t)
|
|
9329
|
+
return a?`[${l}](${r} "${a}")`:`[${l}](${r})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t
|
|
9330
9330
|
return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{}
|
|
9331
9331
|
return!(n&&!this.options.isAllowedUri(n,{defaultValidate:t=>!!oR(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[sI({find:t=>{const e=[]
|
|
9332
9332
|
if(t){const{protocols:n,defaultProtocol:i}=this.options,o=QO(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!oR(t,n),protocols:n,defaultProtocol:i})))
|
|
@@ -16154,8 +16154,8 @@ const JQ=Mt`
|
|
|
16154
16154
|
`,QQ=Q`<slot></slot>`
|
|
16155
16155
|
const t0=class extends Ve{}.compose({baseName:"rectangle",template:QQ,styles:JQ})
|
|
16156
16156
|
Mi.getOrCreate().withPrefix("spright").register(t0())
|
|
16157
|
-
const e0=Mt`
|
|
16158
|
-
${
|
|
16157
|
+
const e0=t=>`${Po(t)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host::before,:host::after,::before,::after{box-sizing:border-box;}`,n0=Mt`
|
|
16158
|
+
${e0("inline-block")}
|
|
16159
16159
|
|
|
16160
16160
|
:host {
|
|
16161
16161
|
border: 2px solid ${$l};
|
|
@@ -16177,9 +16177,32 @@ const e0=Mt`
|
|
|
16177
16177
|
:host([disabled]) slot {
|
|
16178
16178
|
color: ${yc};
|
|
16179
16179
|
}
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
const
|
|
16184
|
-
|
|
16180
|
+
`,i0=Q`<slot></slot>`
|
|
16181
|
+
const o0=class extends Ve{}.compose({baseName:"button",template:i0,styles:n0})
|
|
16182
|
+
Mi.getOrCreate().withPrefix("ok").register(o0())
|
|
16183
|
+
const s0=Et`
|
|
16184
|
+
user-select: none;
|
|
16185
|
+
-webkit-user-select: none;
|
|
16186
|
+
`,r0=Mt`
|
|
16187
|
+
${e0("inline-flex")}
|
|
16188
|
+
|
|
16189
|
+
:host {
|
|
16190
|
+
align-items: center;
|
|
16191
|
+
${s0}
|
|
16192
|
+
width: ${jl};
|
|
16193
|
+
height: ${jl};
|
|
16194
|
+
}
|
|
16195
|
+
|
|
16196
|
+
img {
|
|
16197
|
+
width: 100%;
|
|
16198
|
+
height: 100%;
|
|
16199
|
+
}
|
|
16200
|
+
`,a0=Q`<img aria-hidden="true" src=${t=>t.url}>`
|
|
16201
|
+
class l0 extends im{constructor(t){super(),this.url=t}static registerIconDynamic(t,e){const n="ok-icon-dynamic-"
|
|
16202
|
+
if(!t.startsWith(n))throw new Error(`Icon tag name must start with '${n}', provided name: ${t}`)
|
|
16203
|
+
const i=t.substring(16)
|
|
16204
|
+
if(!/^[a-z][a-z]+$/.test(i))throw new Error(`Icon name must be lowercase [a-z] and at least two characters long, provided name: ${i}`)
|
|
16205
|
+
const o=`IconDynamic${i.charAt(0).toUpperCase()+i.slice(1)}`,s=`icon-dynamic-${i}`,r={[o]:class extends l0{constructor(){super(e)}}}[o].compose({baseName:s,template:a0,styles:r0})
|
|
16206
|
+
Mi.getOrCreate().withPrefix("ok").register(r())}}const c0=l0.compose({baseName:"icon-dynamic",template:Q`<template></template>`,styles:Mt`${e0("none")}`})
|
|
16207
|
+
Mi.getOrCreate().withPrefix("ok").register(c0())}()
|
|
16185
16208
|
//# sourceMappingURL=all-components-bundle.min.js.map
|