@htmlbricks/hb-stylus-notebook 0.16.39 → 0.16.41

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.39",
5
+ "version": "0.16.41",
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.39",
33
+ "@htmlbricks/hb-jsutils": "^0.16.41",
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": "bb93a1c97cfc344848aaacd52a69f858a5eb9056",
78
+ "gitHead": "af9009ccfa1f73f0aaf34e60b874d966f79beb93",
79
79
  "dependencies": {
80
- "@htmlbricks/hb-stylus-paper": "^0.16.39",
80
+ "@htmlbricks/hb-stylus-paper": "^0.16.41",
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.39"
144
+ "version": "0.16.41"
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(){return t=" ",document.createTextNode(t);var t}function d(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function f(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function p(t,n,e){n in t?t[n]="boolean"==typeof t[n]&&""===e||e:f(t,n,e)}function h(t){const n={};for(const e of t)n[e.name]=e.value;return n}let g;function v(t){g=t}function m(){if(!g)throw new Error("Function called outside component initialization");return g}function y(){const t=m();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=[],E=[],x=Promise.resolve();let _=!1;function k(t){w.push(t)}const C=new Set;let j=0;function L(){const t=g;do{for(;j<$.length;){const t=$[j];j++,v(t),A(t.$$)}for(v(null),$.length=0,j=0;b.length;)b.pop()();for(let t=0;t<w.length;t+=1){const n=w[t];C.has(n)||(C.add(n),n())}w.length=0}while($.length);for(;E.length;)E.pop()();_=!1,C.clear(),v(t)}function A(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(k)}}const T=new Set;function D(t,n){-1===t.$$.dirty[0]&&($.push(t),_||(_=!0,x.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function N(i,a,s,c,u,d,f,p=[-1]){const h=g;v(i);const m=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(m.root);let y=!1;if(m.ctx=s?s(i,a.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return m.ctx&&u(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),y&&D(i,t)),n})):[],m.update(),y=!0,o(m.before_update),m.fragment=!!c&&c(m.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();a.intro&&(($=i.$$.fragment)&&$.i&&(T.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||k((()=>{const e=l.map(n).filter(r);c?c.push(...e):o(e),t.$$.on_mount=[]})),u.forEach(k)}(i,a.target,a.anchor,a.customElement),L()}var $,b;v(h)}let P;"function"==typeof HTMLElement&&(P=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 O="0.16.39",S=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,M=/\n/g,R=/^\s*/,I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,B=/^:\s*/,F=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,H=/^[;\s]*/,W=/^\s+|\s+$/g,z="";function q(t){return t?t.replace(W,z):z}var J=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(M);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;z!=t.charAt(e)&&("*"!=t.charAt(e)||"/"!=t.charAt(e+1));)++e;if(e+=2,z===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(I);if(n){if(d(),!l(B))return s("property missing ':'");var e=l(F),o=t({type:"declaration",property:q(n[0].replace(S,z)),value:e?q(e[0].replace(S,z)):z});return l(H),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 K,V=(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}(K={exports:{}},K.exports),K.exports),G={vars:[],parts:[]};function Q(n){let e,r,i,h,g,v,m,y,$,b,w;return{c(){var o,a,s,l;e=c("div"),r=c("button"),r.textContent="clear",i=u(),h=c("button"),h.textContent="select",g=u(),v=c("button"),v.textContent="draw",m=u(),y=c("div"),$=c("hb-stylus-paper"),this.c=t,f(e,"part","controller"),f(e,"id","controller"),p($,"id","stylus-paper"),p($,"style",n[1]),p($,"background_color","green"),p($,"mode",n[0]),f(y,"part","paper-container"),f(y,"id","paper-container"),o=y,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,h),a(e,g),a(e,v),s(t,m,o),s(t,y,o),a(y,$),b||(w=[d(r,"click",n[9]),d(h,"click",n[10]),d(v,"click",n[11])],b=!0)},p(t,[n]){2&n&&p($,"style",t[1]),1&n&&p($,"mode",t[0])},i:t,o:t,d(t){t&&l(e),t&&l(m),t&&l(y),b=!1,o(w)}}}function U(t,n,e){const o=m();y();let r,{id:i}=n,{style:a}=n,{string:s}=n,{json:l}=n,{boolean:c}=n,u="draw",d="";function f(t){e(0,u=t)}V.addComponent({repoName:"@htmlbricks/hb-stylus-paper",version:O}),function(t){m().$$.on_mount.push(t)}((()=>{console.log(o.shadowRoot.getElementById("skeletontest"))}));return t.$$set=t=>{"id"in t&&e(3,i=t.id),"style"in t&&e(7,a=t.style),"string"in t&&e(4,s=t.string),"json"in t&&e(5,l=t.json),"boolean"in t&&e(6,c=t.boolean)},t.$$.update=()=>{if(504&t.$$.dirty){if(i||e(3,i=""),a&&(e(8,r=J(a)),e(1,d=V.getChildStyleToPass(r,null==G?void 0:G.vars))),s||e(4,s=""),"string"==typeof l)try{e(5,l=JSON.parse(l))}catch(t){console.error("error parsing json",t)}""===c&&e(6,c=!0),"string"==typeof c&&e(6,c="no"!==c&&"false"!==c),c||e(6,c=!1)}},[u,d,f,i,s,l,c,a,r,()=>f("eraser"),()=>f("select"),()=>f("draw")]}class X extends P{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>',N(this,{target:this.shadowRoot,props:h(this.attributes),customElement:!0},U,Q,i,{id:3,style:7,string:4,json:5,boolean:6},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),L()))}static get observedAttributes(){return["id","style","string","json","boolean"]}get id(){return this.$$.ctx[3]}set id(t){this.$$set({id:t}),L()}get style(){return this.$$.ctx[7]}set style(t){this.$$set({style:t}),L()}get string(){return this.$$.ctx[4]}set string(t){this.$$set({string:t}),L()}get json(){return this.$$.ctx[5]}set json(t){this.$$set({json:t}),L()}get boolean(){return this.$$.ctx[6]}set boolean(t){this.$$set({boolean:t}),L()}}return customElements.define("hb-stylus-notebook",X),X}();
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(){return t=" ",document.createTextNode(t);var t}function d(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function f(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function p(t,n,e){n in t?t[n]="boolean"==typeof t[n]&&""===e||e:f(t,n,e)}function h(t){const n={};for(const e of t)n[e.name]=e.value;return n}let g;function v(t){g=t}function m(){if(!g)throw new Error("Function called outside component initialization");return g}function y(){const t=m();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=[],E=[],x=Promise.resolve();let _=!1;function k(t){w.push(t)}const C=new Set;let j=0;function L(){const t=g;do{for(;j<$.length;){const t=$[j];j++,v(t),A(t.$$)}for(v(null),$.length=0,j=0;b.length;)b.pop()();for(let t=0;t<w.length;t+=1){const n=w[t];C.has(n)||(C.add(n),n())}w.length=0}while($.length);for(;E.length;)E.pop()();_=!1,C.clear(),v(t)}function A(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(k)}}const T=new Set;function D(t,n){-1===t.$$.dirty[0]&&($.push(t),_||(_=!0,x.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function N(i,a,s,c,u,d,f,p=[-1]){const h=g;v(i);const m=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(m.root);let y=!1;if(m.ctx=s?s(i,a.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return m.ctx&&u(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),y&&D(i,t)),n})):[],m.update(),y=!0,o(m.before_update),m.fragment=!!c&&c(m.ctx),a.target){if(a.hydrate){const t=function(t){return Array.from(t.childNodes)}(a.target);m.fragment&&m.fragment.l(t),t.forEach(l)}else m.fragment&&m.fragment.c();a.intro&&(($=i.$$.fragment)&&$.i&&(T.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||k((()=>{const e=l.map(n).filter(r);c?c.push(...e):o(e),t.$$.on_mount=[]})),u.forEach(k)}(i,a.target,a.anchor,a.customElement),L()}var $,b;v(h)}let P;"function"==typeof HTMLElement&&(P=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 O="0.16.41",S=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,M=/\n/g,R=/^\s*/,I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,B=/^:\s*/,F=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,H=/^[;\s]*/,W=/^\s+|\s+$/g,z="";function q(t){return t?t.replace(W,z):z}var J=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(M);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;z!=t.charAt(e)&&("*"!=t.charAt(e)||"/"!=t.charAt(e+1));)++e;if(e+=2,z===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(I);if(n){if(d(),!l(B))return s("property missing ':'");var e=l(F),o=t({type:"declaration",property:q(n[0].replace(S,z)),value:e?q(e[0].replace(S,z)):z});return l(H),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 K,V=(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}(K={exports:{}},K.exports),K.exports),G={vars:[],parts:[]};function Q(n){let e,r,i,h,g,v,m,y,$,b,w;return{c(){var o,a,s,l;e=c("div"),r=c("button"),r.textContent="clear",i=u(),h=c("button"),h.textContent="select",g=u(),v=c("button"),v.textContent="draw",m=u(),y=c("div"),$=c("hb-stylus-paper"),this.c=t,f(e,"part","controller"),f(e,"id","controller"),p($,"id","stylus-paper"),p($,"style",n[1]),p($,"background_color","green"),p($,"mode",n[0]),f(y,"part","paper-container"),f(y,"id","paper-container"),o=y,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,h),a(e,g),a(e,v),s(t,m,o),s(t,y,o),a(y,$),b||(w=[d(r,"click",n[9]),d(h,"click",n[10]),d(v,"click",n[11])],b=!0)},p(t,[n]){2&n&&p($,"style",t[1]),1&n&&p($,"mode",t[0])},i:t,o:t,d(t){t&&l(e),t&&l(m),t&&l(y),b=!1,o(w)}}}function U(t,n,e){const o=m();y();let r,{id:i}=n,{style:a}=n,{string:s}=n,{json:l}=n,{boolean:c}=n,u="draw",d="";function f(t){e(0,u=t)}V.addComponent({repoName:"@htmlbricks/hb-stylus-paper",version:O}),function(t){m().$$.on_mount.push(t)}((()=>{console.log(o.shadowRoot.getElementById("skeletontest"))}));return t.$$set=t=>{"id"in t&&e(3,i=t.id),"style"in t&&e(7,a=t.style),"string"in t&&e(4,s=t.string),"json"in t&&e(5,l=t.json),"boolean"in t&&e(6,c=t.boolean)},t.$$.update=()=>{if(504&t.$$.dirty){if(i||e(3,i=""),a&&(e(8,r=J(a)),e(1,d=V.getChildStyleToPass(r,null==G?void 0:G.vars))),s||e(4,s=""),"string"==typeof l)try{e(5,l=JSON.parse(l))}catch(t){console.error("error parsing json",t)}""===c&&e(6,c=!0),"string"==typeof c&&e(6,c="no"!==c&&"false"!==c),c||e(6,c=!1)}},[u,d,f,i,s,l,c,a,r,()=>f("eraser"),()=>f("select"),()=>f("draw")]}class X extends P{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>',N(this,{target:this.shadowRoot,props:h(this.attributes),customElement:!0},U,Q,i,{id:3,style:7,string:4,json:5,boolean:6},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),L()))}static get observedAttributes(){return["id","style","string","json","boolean"]}get id(){return this.$$.ctx[3]}set id(t){this.$$set({id:t}),L()}get style(){return this.$$.ctx[7]}set style(t){this.$$set({style:t}),L()}get string(){return this.$$.ctx[4]}set string(t){this.$$set({string:t}),L()}get json(){return this.$$.ctx[5]}set json(t){this.$$set({json:t}),L()}get boolean(){return this.$$.ctx[6]}set boolean(t){this.$$set({boolean:t}),L()}}return customElements.define("hb-stylus-notebook",X),X}();
2
2
  //# sourceMappingURL=release.js.map