@htmlbricks/hb-stylus-notebook 0.16.45 → 0.16.46

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@htmlbricks/hb-stylus-notebook",
3
3
  "displayName": "Svelte-Bootstrap stylus-notebook",
4
4
  "description": "Svelte-Bootstrap stylus-notebook",
5
- "version": "0.16.45",
5
+ "version": "0.16.46",
6
6
  "main": "release/release.js",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "prepublish": "npm run build:release"
31
31
  },
32
32
  "devDependencies": {
33
- "@htmlbricks/hb-jsutils": "^0.16.45",
33
+ "@htmlbricks/hb-jsutils": "^0.16.46",
34
34
  "@htmlbricks/manifester": "^0.0.22",
35
35
  "@rollup/plugin-alias": "^3.1.2",
36
36
  "@rollup/plugin-commonjs": "^18.0.0",
@@ -75,9 +75,9 @@
75
75
  "webcomponents"
76
76
  ],
77
77
  "contributors": [],
78
- "gitHead": "b0e6c7357d096939f5fce42b988236891aeaa827",
78
+ "gitHead": "d9576359b151721201e0c8546630d07592dd9fb9",
79
79
  "dependencies": {
80
- "@htmlbricks/hb-stylus-paper": "^0.16.45",
80
+ "@htmlbricks/hb-stylus-paper": "^0.16.46",
81
81
  "style-to-object": "^0.3.0"
82
82
  }
83
83
  }
@@ -141,5 +141,5 @@
141
141
  },
142
142
  "iifePath": "release/release.js",
143
143
  "repoName": "@htmlbricks/hb-stylus-notebook",
144
- "version": "0.16.45"
144
+ "version": "0.16.46"
145
145
  }
@@ -1,2 +1,2 @@
1
- var release=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function o(t){t.forEach(n)}function r(t){return"function"==typeof t}function i(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function a(t,n){t.appendChild(n)}function s(t,n,e){t.insertBefore(n,e||null)}function l(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function u(t){return document.createTextNode(t)}function d(){return u(" ")}function f(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function p(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function h(t,n,e){n in t?t[n]="boolean"==typeof t[n]&&""===e||e:p(t,n,e)}function g(t){const n={};for(const e of t)n[e.name]=e.value;return n}let v;function m(t){v=t}function y(){if(!v)throw new Error("Function called outside component initialization");return v}function $(){const t=y();return(n,e,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[n];if(r){const i=function(t,n,{bubbles:e=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e,o,n),r}(n,e,{cancelable:o});return r.slice().forEach((n=>{n.call(t,i)})),!i.defaultPrevented}return!0}}const b=[],w=[],x=[],E=[],_=Promise.resolve();let k=!1;function C(t){x.push(t)}const j=new Set;let L=0;function A(){const t=v;do{for(;L<b.length;){const t=b[L];L++,m(t),T(t.$$)}for(m(null),b.length=0,L=0;w.length;)w.pop()();for(let t=0;t<x.length;t+=1){const n=x[t];j.has(n)||(j.add(n),n())}x.length=0}while(b.length);for(;E.length;)E.pop()();k=!1,j.clear(),m(t)}function T(t){if(null!==t.fragment){t.update(),o(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(C)}}const D=new Set;function N(t,n){-1===t.$$.dirty[0]&&(b.push(t),k||(k=!0,_.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function P(i,a,s,c,u,d,f,p=[-1]){const h=v;m(i);const g=i.$$={fragment:null,ctx:null,props:d,update:t,not_equal:u,bound:e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(h?h.$$.context:[])),callbacks:e(),dirty:p,skip_bound:!1,root:a.target||h.$$.root};f&&f(g.root);let y=!1;if(g.ctx=s?s(i,a.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),y&&N(i,t)),n})):[],g.update(),y=!0,o(g.before_update),g.fragment=!!c&&c(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);g.fragment&&g.fragment.l(t),t.forEach(l)}else g.fragment&&g.fragment.c();a.intro&&(($=i.$$.fragment)&&$.i&&(D.delete($),$.i(b))),function(t,e,i,a){const{fragment:s,on_mount:l,on_destroy:c,after_update:u}=t.$$;s&&s.m(e,i),a||C((()=>{const e=l.map(n).filter(r);c?c.push(...e):o(e),t.$$.on_mount=[]})),u.forEach(C)}(i,a.target,a.anchor,a.customElement),A()}var $,b;m(h)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,n,e){this[t]=e}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var S="0.16.45",M=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,I=/\n/g,R=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F=/^:\s*/,H=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,z=/^\s+|\s+$/g,q="";function J(t){return t?t.replace(z,q):q}var K=function(t,n){var e,o=null;if(!t||"string"!=typeof t)return o;for(var r,i,a=function(t,n){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];n=n||{};var e=1,o=1;function r(t){var n=t.match(I);n&&(e+=n.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function i(){var t={line:e,column:o};return function(n){return n.position=new a(t),c(),n}}function a(t){this.start=t,this.end={line:e,column:o},this.source=n.source}function s(r){var i=new Error(n.source+":"+e+":"+o+": "+r);if(i.reason=r,i.filename=n.source,i.line=e,i.column=o,i.source=t,!n.silent)throw i}function l(n){var e=n.exec(t);if(e){var o=e[0];return r(o),t=t.slice(o.length),e}}function c(){l(R)}function u(t){var n;for(t=t||[];n=d();)!1!==n&&t.push(n);return t}function d(){var n=i();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var e=2;q!=t.charAt(e)&&("*"!=t.charAt(e)||"/"!=t.charAt(e+1));)++e;if(e+=2,q===t.charAt(e-1))return s("End of comment missing");var a=t.slice(2,e-2);return o+=2,r(a),t=t.slice(e),o+=2,n({type:"comment",comment:a})}}function f(){var t=i(),n=l(B);if(n){if(d(),!l(F))return s("property missing ':'");var e=l(H),o=t({type:"declaration",property:J(n[0].replace(M,q)),value:e?J(e[0].replace(M,q)):q});return l(W),o}}return a.prototype.content=t,c(),function(){var t,n=[];for(u(n);t=f();)!1!==t&&(n.push(t),u(n));return n}()}(t),s="function"==typeof n,l=0,c=a.length;l<c;l++)r=(e=a[l]).property,i=e.value,s?n(r,i,e):i&&(o||(o={}),o[r]=i);return o};var V,G=(function(t,n){n.__esModule=!0,n.LanguageTranslator=n.addComponent=n.getChildStyleToPass=void 0,n.getChildStyleToPass=function(t,n){var e,o,r="";if(t&&(null==n?void 0:n.length)&&(null===(e=Object.keys(t))||void 0===e?void 0:e.length)&&(null===(o=null==n?void 0:n.filter((function(n){return Object.keys(t).includes(n.name)})))||void 0===o?void 0:o.length))for(var i=function(e){(null==n?void 0:n.filter((function(n){return n.name===e&&n.defaultValue!==t[e]})))&&(r+="".concat(e,":").concat(t[e],";"))},a=0,s=Object.keys(t);a<s.length;a++)i(s[a]);return r},n.addComponent=function(t){var n,e=(null===(n=null==t?void 0:t.repoName.split("/"))||void 0===n?void 0:n[1])||(null==t?void 0:t.repoName);if(!e)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(e+"-script"))try{var r=document.createElement("script");r.id=e+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var e=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(n){n||(n=t.getDefaultLang()),this.lang=n},t.prototype.translateWord=function(n,e){return t.getDictionaryWord(n,this.dictionary,e||this.lang)},t.prototype.translateDate=function(n,e,o){return t.formatDate(n,e,o||this.lang)},t.getDefaultLang=function(){var t,n,e,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(e=null===(n=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===n?void 0:n.toLowerCase())||void 0===e?void 0:e.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(n,e,o){var r;if(!n)throw new Error("no wordKey provided");if(!e)throw new Error("no dictionary provided");if(o&&(null===(r=e[o])||void 0===r?void 0:r[n]))return e[o][n];var i="",a=t.getDefaultLang();if(!o||a!==o){var s=null==e?void 0:e[a];(null==s?void 0:s[n])&&(i=s[n])}return i},t.formatDate=function(n,e,o){if(!n)throw new Error("no date provided");if("function"!=typeof n.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),e).format(n)},t}();n.LanguageTranslator=e}(V={exports:{}},V.exports),V.exports),Q={vars:[],parts:[]};function U(n){let e,r,i,g,v,m,y,$,b,w,x,E,_,k,C,j,L,A,T;return{c(){var o,a,s,l;e=c("div"),r=c("button"),r.textContent="clear",i=d(),g=c("button"),g.textContent="select",v=d(),m=c("button"),m.textContent="draw",y=d(),$=c("button"),b=u("undo"),x=d(),E=c("button"),_=u("redo"),C=d(),j=c("div"),L=c("hb-stylus-paper"),this.c=t,$.disabled=w=!n[3],E.disabled=k=!n[4],p(e,"part","controller"),p(e,"id","controller"),h(L,"id","stylus-paper"),h(L,"goto",n[0]),h(L,"style",n[2]),h(L,"background_color","green"),h(L,"mode",n[1]),p(j,"part","paper-container"),p(j,"id","paper-container"),o=j,a="position",null===(s="relative")?o.style.removeProperty(a):o.style.setProperty(a,s,l?"important":"")},m(t,o){s(t,e,o),a(e,r),a(e,i),a(e,g),a(e,v),a(e,m),a(e,y),a(e,$),a($,b),a(e,x),a(e,E),a(E,_),s(t,C,o),s(t,j,o),a(j,L),A||(T=[f(r,"click",n[16]),f(g,"click",n[17]),f(m,"click",n[18]),f($,"click",n[19]),f(E,"click",n[20]),f(L,"historyIndex",n[21])],A=!0)},p(t,[n]){8&n&&w!==(w=!t[3])&&($.disabled=w),16&n&&k!==(k=!t[4])&&(E.disabled=k),1&n&&h(L,"goto",t[0]),4&n&&h(L,"style",t[2]),2&n&&h(L,"mode",t[1])},i:t,o:t,d(t){t&&l(e),t&&l(C),t&&l(j),A=!1,o(T)}}}function X(t,n,e){const o=y();$();let r,i,a,s,{id:l}=n,{style:c}=n,{string:u}=n,{json:d}=n,{boolean:f}=n,p="draw",h="",g=!1;function v(t){e(1,p=t)}function m(){console.log(i,a),i>=0&&(!a||a>-1)&&e(0,a=a||0===a?a-1:i)}function b(){console.log(i,a),(a||0===a)&&a<=i&&e(0,a++,a)}function w(t){console.log(t),e(15,i=t.i||t.index||0),i>-1&&e(3,g=!0),e(0,a=null),console.log(i,a,t)}G.addComponent({repoName:"@htmlbricks/hb-stylus-paper",version:S}),function(t){y().$$.on_mount.push(t)}((()=>{console.log(o.shadowRoot.getElementById("skeletontest"))}));return t.$$set=t=>{"id"in t&&e(9,l=t.id),"style"in t&&e(13,c=t.style),"string"in t&&e(10,u=t.string),"json"in t&&e(11,d=t.json),"boolean"in t&&e(12,f=t.boolean)},t.$$.update=()=>{if(65025&t.$$.dirty){if(l||e(9,l=""),c&&(e(14,r=K(c)),e(2,h=G.getChildStyleToPass(r,null==Q?void 0:Q.vars))),u||e(10,u=""),i||0===i||e(15,i=0),e(4,s=!(0!==a&&!a||!(a<=i))),"string"==typeof d)try{e(11,d=JSON.parse(d))}catch(t){console.error("error parsing json",t)}""===f&&e(12,f=!0),"string"==typeof f&&e(12,f="no"!==f&&"false"!==f),f||e(12,f=!1)}},[a,p,h,g,s,v,m,b,w,l,u,d,f,c,r,i,()=>v("eraser"),()=>v("select"),()=>v("draw"),()=>m(),()=>b(),t=>w(t.detail)]}class Y extends O{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr}#controller{grid-area:header}#paper-container{grid-area:paper;background:green}</style>',P(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},X,U,i,{id:9,style:13,string:10,json:11,boolean:12},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","string","json","boolean"]}get id(){return this.$$.ctx[9]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[13]}set style(t){this.$$set({style:t}),A()}get string(){return this.$$.ctx[10]}set string(t){this.$$set({string:t}),A()}get json(){return this.$$.ctx[11]}set json(t){this.$$set({json:t}),A()}get boolean(){return this.$$.ctx[12]}set boolean(t){this.$$set({boolean:t}),A()}}return customElements.define("hb-stylus-notebook",Y),Y}();
1
+ var release=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function o(t){t.forEach(n)}function r(t){return"function"==typeof t}function i(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function a(t,n){t.appendChild(n)}function s(t,n,e){t.insertBefore(n,e||null)}function l(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function u(t){return document.createTextNode(t)}function d(){return u(" ")}function f(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function p(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function h(t,n,e){n in t?t[n]="boolean"==typeof t[n]&&""===e||e:p(t,n,e)}function g(t){const n={};for(const e of t)n[e.name]=e.value;return n}let v;function m(t){v=t}function y(){if(!v)throw new Error("Function called outside component initialization");return v}function $(){const t=y();return(n,e,{cancelable:o=!1}={})=>{const r=t.$$.callbacks[n];if(r){const i=function(t,n,{bubbles:e=!1,cancelable:o=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e,o,n),r}(n,e,{cancelable:o});return r.slice().forEach((n=>{n.call(t,i)})),!i.defaultPrevented}return!0}}const b=[],w=[],x=[],E=[],_=Promise.resolve();let k=!1;function C(t){x.push(t)}const j=new Set;let L=0;function A(){const t=v;do{for(;L<b.length;){const t=b[L];L++,m(t),T(t.$$)}for(m(null),b.length=0,L=0;w.length;)w.pop()();for(let t=0;t<x.length;t+=1){const n=x[t];j.has(n)||(j.add(n),n())}x.length=0}while(b.length);for(;E.length;)E.pop()();k=!1,j.clear(),m(t)}function T(t){if(null!==t.fragment){t.update(),o(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(C)}}const D=new Set;function N(t,n){-1===t.$$.dirty[0]&&(b.push(t),k||(k=!0,_.then(A)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function P(i,a,s,c,u,d,f,p=[-1]){const h=v;m(i);const g=i.$$={fragment:null,ctx:null,props:d,update:t,not_equal:u,bound:e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a.context||(h?h.$$.context:[])),callbacks:e(),dirty:p,skip_bound:!1,root:a.target||h.$$.root};f&&f(g.root);let y=!1;if(g.ctx=s?s(i,a.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return g.ctx&&u(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),y&&N(i,t)),n})):[],g.update(),y=!0,o(g.before_update),g.fragment=!!c&&c(g.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);g.fragment&&g.fragment.l(t),t.forEach(l)}else g.fragment&&g.fragment.c();a.intro&&(($=i.$$.fragment)&&$.i&&(D.delete($),$.i(b))),function(t,e,i,a){const{fragment:s,on_mount:l,on_destroy:c,after_update:u}=t.$$;s&&s.m(e,i),a||C((()=>{const e=l.map(n).filter(r);c?c.push(...e):o(e),t.$$.on_mount=[]})),u.forEach(C)}(i,a.target,a.anchor,a.customElement),A()}var $,b;m(h)}let O;"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,n,e){this[t]=e}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var S="0.16.46",M=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,I=/\n/g,R=/^\s*/,B=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F=/^:\s*/,H=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,W=/^[;\s]*/,z=/^\s+|\s+$/g,q="";function J(t){return t?t.replace(z,q):q}var K=function(t,n){var e,o=null;if(!t||"string"!=typeof t)return o;for(var r,i,a=function(t,n){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];n=n||{};var e=1,o=1;function r(t){var n=t.match(I);n&&(e+=n.length);var r=t.lastIndexOf("\n");o=~r?t.length-r:o+t.length}function i(){var t={line:e,column:o};return function(n){return n.position=new a(t),c(),n}}function a(t){this.start=t,this.end={line:e,column:o},this.source=n.source}function s(r){var i=new Error(n.source+":"+e+":"+o+": "+r);if(i.reason=r,i.filename=n.source,i.line=e,i.column=o,i.source=t,!n.silent)throw i}function l(n){var e=n.exec(t);if(e){var o=e[0];return r(o),t=t.slice(o.length),e}}function c(){l(R)}function u(t){var n;for(t=t||[];n=d();)!1!==n&&t.push(n);return t}function d(){var n=i();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var e=2;q!=t.charAt(e)&&("*"!=t.charAt(e)||"/"!=t.charAt(e+1));)++e;if(e+=2,q===t.charAt(e-1))return s("End of comment missing");var a=t.slice(2,e-2);return o+=2,r(a),t=t.slice(e),o+=2,n({type:"comment",comment:a})}}function f(){var t=i(),n=l(B);if(n){if(d(),!l(F))return s("property missing ':'");var e=l(H),o=t({type:"declaration",property:J(n[0].replace(M,q)),value:e?J(e[0].replace(M,q)):q});return l(W),o}}return a.prototype.content=t,c(),function(){var t,n=[];for(u(n);t=f();)!1!==t&&(n.push(t),u(n));return n}()}(t),s="function"==typeof n,l=0,c=a.length;l<c;l++)r=(e=a[l]).property,i=e.value,s?n(r,i,e):i&&(o||(o={}),o[r]=i);return o};var V,G=(function(t,n){n.__esModule=!0,n.LanguageTranslator=n.addComponent=n.getChildStyleToPass=void 0,n.getChildStyleToPass=function(t,n){var e,o,r="";if(t&&(null==n?void 0:n.length)&&(null===(e=Object.keys(t))||void 0===e?void 0:e.length)&&(null===(o=null==n?void 0:n.filter((function(n){return Object.keys(t).includes(n.name)})))||void 0===o?void 0:o.length))for(var i=function(e){(null==n?void 0:n.filter((function(n){return n.name===e&&n.defaultValue!==t[e]})))&&(r+="".concat(e,":").concat(t[e],";"))},a=0,s=Object.keys(t);a<s.length;a++)i(s[a]);return r},n.addComponent=function(t){var n,e=(null===(n=null==t?void 0:t.repoName.split("/"))||void 0===n?void 0:n[1])||(null==t?void 0:t.repoName);if(!e)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var o=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(e+"-script"))try{var r=document.createElement("script");r.id=e+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(o),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var e=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(n){n||(n=t.getDefaultLang()),this.lang=n},t.prototype.translateWord=function(n,e){return t.getDictionaryWord(n,this.dictionary,e||this.lang)},t.prototype.translateDate=function(n,e,o){return t.formatDate(n,e,o||this.lang)},t.getDefaultLang=function(){var t,n,e,o,r,i="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(e=null===(n=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===n?void 0:n.toLowerCase())||void 0===e?void 0:e.length)&&(i=null===(r=null===(o=navigator.languages[0])||void 0===o?void 0:o.split("-")[0])||void 0===r?void 0:r.toLowerCase()),i},t.getDictionaryWord=function(n,e,o){var r;if(!n)throw new Error("no wordKey provided");if(!e)throw new Error("no dictionary provided");if(o&&(null===(r=e[o])||void 0===r?void 0:r[n]))return e[o][n];var i="",a=t.getDefaultLang();if(!o||a!==o){var s=null==e?void 0:e[a];(null==s?void 0:s[n])&&(i=s[n])}return i},t.formatDate=function(n,e,o){if(!n)throw new Error("no date provided");if("function"!=typeof n.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(o||t.getDefaultLang(),e).format(n)},t}();n.LanguageTranslator=e}(V={exports:{}},V.exports),V.exports),Q={vars:[],parts:[]};function U(n){let e,r,i,g,v,m,y,$,b,w,x,E,_,k,C,j,L,A,T;return{c(){var o,a,s,l;e=c("div"),r=c("button"),r.textContent="clear",i=d(),g=c("button"),g.textContent="select",v=d(),m=c("button"),m.textContent="draw",y=d(),$=c("button"),b=u("undo"),x=d(),E=c("button"),_=u("redo"),C=d(),j=c("div"),L=c("hb-stylus-paper"),this.c=t,$.disabled=w=!n[3],E.disabled=k=!n[4],p(e,"part","controller"),p(e,"id","controller"),h(L,"id","stylus-paper"),h(L,"goto",n[0]),h(L,"style",n[2]),h(L,"background_color","green"),h(L,"mode",n[1]),p(j,"part","paper-container"),p(j,"id","paper-container"),o=j,a="position",null===(s="relative")?o.style.removeProperty(a):o.style.setProperty(a,s,l?"important":"")},m(t,o){s(t,e,o),a(e,r),a(e,i),a(e,g),a(e,v),a(e,m),a(e,y),a(e,$),a($,b),a(e,x),a(e,E),a(E,_),s(t,C,o),s(t,j,o),a(j,L),A||(T=[f(r,"click",n[16]),f(g,"click",n[17]),f(m,"click",n[18]),f($,"click",n[19]),f(E,"click",n[20]),f(L,"historyIndex",n[21])],A=!0)},p(t,[n]){8&n&&w!==(w=!t[3])&&($.disabled=w),16&n&&k!==(k=!t[4])&&(E.disabled=k),1&n&&h(L,"goto",t[0]),4&n&&h(L,"style",t[2]),2&n&&h(L,"mode",t[1])},i:t,o:t,d(t){t&&l(e),t&&l(C),t&&l(j),A=!1,o(T)}}}function X(t,n,e){const o=y();$();let r,i,a,s,{id:l}=n,{style:c}=n,{string:u}=n,{json:d}=n,{boolean:f}=n,p="draw",h="",g=!1;function v(t){e(1,p=t)}function m(){console.log(i,a),i>=0&&(!a||a>-1)&&e(0,a=a||0===a?a-1:i)}function b(){console.log(i,a),(a||0===a)&&a<=i&&e(0,a++,a)}function w(t){console.log(t),e(15,i=t.i||t.index||0),i>-1&&e(3,g=!0),e(0,a=null),console.log(i,a,t)}G.addComponent({repoName:"@htmlbricks/hb-stylus-paper",version:S}),function(t){y().$$.on_mount.push(t)}((()=>{console.log(o.shadowRoot.getElementById("skeletontest"))}));return t.$$set=t=>{"id"in t&&e(9,l=t.id),"style"in t&&e(13,c=t.style),"string"in t&&e(10,u=t.string),"json"in t&&e(11,d=t.json),"boolean"in t&&e(12,f=t.boolean)},t.$$.update=()=>{if(65025&t.$$.dirty){if(l||e(9,l=""),c&&(e(14,r=K(c)),e(2,h=G.getChildStyleToPass(r,null==Q?void 0:Q.vars))),u||e(10,u=""),i||0===i||e(15,i=0),e(4,s=!(0!==a&&!a||!(a<=i))),"string"==typeof d)try{e(11,d=JSON.parse(d))}catch(t){console.error("error parsing json",t)}""===f&&e(12,f=!0),"string"==typeof f&&e(12,f="no"!==f&&"false"!==f),f||e(12,f=!1)}},[a,p,h,g,s,v,m,b,w,l,u,d,f,c,r,i,()=>v("eraser"),()=>v("select"),()=>v("draw"),()=>m(),()=>b(),t=>w(t.detail)]}class Y extends O{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;position:absolute;width:100%;height:100%;display:block;display:grid;grid-template-areas:"header" "paper";grid-template-columns:1fr;grid-template-rows:auto 1fr}#controller{grid-area:header}#paper-container{grid-area:paper;background:green}</style>',P(this,{target:this.shadowRoot,props:g(this.attributes),customElement:!0},X,U,i,{id:9,style:13,string:10,json:11,boolean:12},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),A()))}static get observedAttributes(){return["id","style","string","json","boolean"]}get id(){return this.$$.ctx[9]}set id(t){this.$$set({id:t}),A()}get style(){return this.$$.ctx[13]}set style(t){this.$$set({style:t}),A()}get string(){return this.$$.ctx[10]}set string(t){this.$$set({string:t}),A()}get json(){return this.$$.ctx[11]}set json(t){this.$$set({json:t}),A()}get boolean(){return this.$$.ctx[12]}set boolean(t){this.$$set({boolean:t}),A()}}return customElements.define("hb-stylus-notebook",Y),Y}();
2
2
  //# sourceMappingURL=release.js.map