@swisspost/design-system-components 1.3.1 → 1.3.2

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.
Files changed (84) hide show
  1. package/dist/cjs/check-type-f24cf91d.js +24 -0
  2. package/dist/cjs/check-type-f24cf91d.js.map +1 -0
  3. package/dist/cjs/{index-8880977f.js → index-a8b23f1b.js} +1 -1
  4. package/dist/cjs/{index-8880977f.js.map → index-a8b23f1b.js.map} +1 -1
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/loader.cjs.js.map +1 -1
  7. package/dist/cjs/post-collapsible.cjs.entry.js +11 -19
  8. package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
  9. package/dist/cjs/post-components.cjs.js +3 -3
  10. package/dist/cjs/post-components.cjs.js.map +1 -1
  11. package/dist/cjs/post-icon.cjs.entry.js +39 -29
  12. package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
  13. package/dist/collection/collection-manifest.json +1 -1
  14. package/dist/collection/components/post-collapsible/post-collapsible.css +1251 -3863
  15. package/dist/collection/components/post-collapsible/post-collapsible.js +12 -10
  16. package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
  17. package/dist/collection/components/post-icon/post-icon.js +41 -46
  18. package/dist/collection/components/post-icon/post-icon.js.map +1 -1
  19. package/dist/collection/utils/get-element-height.js +0 -3
  20. package/dist/collection/utils/get-element-height.js.map +1 -1
  21. package/dist/collection/utils/index.js +0 -3
  22. package/dist/collection/utils/index.js.map +1 -1
  23. package/dist/collection/utils/on-transition-end.js +0 -3
  24. package/dist/collection/utils/on-transition-end.js.map +1 -1
  25. package/dist/collection/utils/property-checkers/check-one-of.js +5 -0
  26. package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -0
  27. package/dist/collection/utils/property-checkers/check-type.js +13 -0
  28. package/dist/collection/utils/property-checkers/check-type.js.map +1 -0
  29. package/dist/collection/utils/property-checkers/empty-or.js +9 -0
  30. package/dist/collection/utils/property-checkers/empty-or.js.map +1 -0
  31. package/dist/collection/utils/property-checkers/index.js +8 -0
  32. package/dist/collection/utils/property-checkers/index.js.map +1 -0
  33. package/dist/collection/utils/should-reduce-motion.js +0 -3
  34. package/dist/collection/utils/should-reduce-motion.js.map +1 -1
  35. package/dist/components/check-type.js +21 -0
  36. package/dist/components/check-type.js.map +1 -0
  37. package/dist/components/post-collapsible.js +12 -19
  38. package/dist/components/post-collapsible.js.map +1 -1
  39. package/dist/components/post-icon.js +37 -30
  40. package/dist/components/post-icon.js.map +1 -1
  41. package/dist/docs.json +2 -2
  42. package/dist/esm/check-type-67411ed3.js +21 -0
  43. package/dist/esm/check-type-67411ed3.js.map +1 -0
  44. package/dist/esm/{index-6d5a72fa.js → index-401f2d6a.js} +1 -1
  45. package/dist/esm/{index-6d5a72fa.js.map → index-401f2d6a.js.map} +1 -1
  46. package/dist/esm/loader.js +4 -4
  47. package/dist/esm/loader.js.map +1 -1
  48. package/dist/esm/post-collapsible.entry.js +10 -18
  49. package/dist/esm/post-collapsible.entry.js.map +1 -1
  50. package/dist/esm/post-components.js +4 -4
  51. package/dist/esm/post-components.js.map +1 -1
  52. package/dist/esm/post-icon.entry.js +35 -25
  53. package/dist/esm/post-icon.entry.js.map +1 -1
  54. package/dist/post-components/{p-d1bc7b0b.entry.js → p-07a51673.entry.js} +2 -2
  55. package/dist/post-components/p-07a51673.entry.js.map +1 -0
  56. package/dist/post-components/p-416f1e74.entry.js +2 -0
  57. package/dist/post-components/p-416f1e74.entry.js.map +1 -0
  58. package/dist/post-components/{p-a93114b9.js → p-f214c52a.js} +1 -1
  59. package/dist/post-components/{p-a93114b9.js.map → p-f214c52a.js.map} +1 -1
  60. package/dist/post-components/p-f549b3fc.js +2 -0
  61. package/dist/post-components/p-f549b3fc.js.map +1 -0
  62. package/dist/post-components/post-components.esm.js +1 -1
  63. package/dist/post-components/post-components.esm.js.map +1 -1
  64. package/dist/types/components/post-collapsible/post-collapsible.d.ts +14 -13
  65. package/dist/types/components/post-icon/post-icon.d.ts +22 -22
  66. package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -0
  67. package/dist/types/utils/property-checkers/check-type.d.ts +2 -0
  68. package/dist/types/utils/property-checkers/empty-or.d.ts +1 -0
  69. package/dist/types/utils/property-checkers/index.d.ts +4 -0
  70. package/package.json +17 -11
  71. package/dist/cjs/property-checkers-586ad9d4.js +0 -40
  72. package/dist/cjs/property-checkers-586ad9d4.js.map +0 -1
  73. package/dist/collection/utils/property-checkers.js +0 -31
  74. package/dist/collection/utils/property-checkers.js.map +0 -1
  75. package/dist/components/property-checkers.js +0 -34
  76. package/dist/components/property-checkers.js.map +0 -1
  77. package/dist/esm/property-checkers-484ca671.js +0 -34
  78. package/dist/esm/property-checkers-484ca671.js.map +0 -1
  79. package/dist/post-components/p-7cd9c1ad.js +0 -2
  80. package/dist/post-components/p-7cd9c1ad.js.map +0 -1
  81. package/dist/post-components/p-b07185a3.entry.js +0 -2
  82. package/dist/post-components/p-b07185a3.entry.js.map +0 -1
  83. package/dist/post-components/p-d1bc7b0b.entry.js.map +0 -1
  84. package/dist/types/utils/property-checkers.d.ts +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getElementHeight","el","classesWhenShown","Array","isArray","classesToAdd","filter","klass","classList","contains","length","add","scrollHeight","remove","shouldReduceMotion","window","matchMedia","matches","async","onTransitionEnd","Promise","resolve","ontransitionend","postCollapsibleCss","nextId","PostCollapsible","this","isLoaded","toggle","validateCollapsed","newValue","collapsed","checkType","isOpen","collapseClasses","getCollapseClasses","setTimeout","validateHeadingLevel","headingLevel","checkOneOf","headingTag","componentWillLoad","hasHeader","host","querySelectorAll","console","warn","collapsibleId","id","componentDidLoad","collapsibleElement","shadowRoot","querySelector","open","startTransition","then","collapseHeight","expandedHeight","render","h","class","style","height","type","onClick","onAccordionButtonClick","name"],"sources":["./src/utils/get-element-height.ts","./src/utils/should-reduce-motion.ts","./src/utils/on-transition-end.ts","./src/components/post-collapsible/post-collapsible.scss?tag=post-collapsible&encapsulation=shadow","./src/components/post-collapsible/post-collapsible.tsx"],"sourcesContent":["export function getElementHeight(el: HTMLElement): number;\nexport function getElementHeight(el: HTMLElement, classWhenShown: string): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string[]): number;\nexport function getElementHeight(el: HTMLElement, classesWhenShown: string | string[] = []): number {\n if (!Array.isArray(classesWhenShown)) classesWhenShown = [classesWhenShown];\n\n const classesToAdd = classesWhenShown.filter(klass => !el.classList.contains(klass));\n if (classesToAdd.length) el.classList.add(...classesToAdd);\n\n const scrollHeight = el.scrollHeight;\n\n if (classesToAdd.length) el.classList.remove(...classesToAdd);\n\n return scrollHeight;\n}\n","export function shouldReduceMotion(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","import { shouldReduceMotion } from './should-reduce-motion';\n\nexport async function onTransitionEnd(el: HTMLElement): Promise<void> {\n return new Promise(resolve => {\n if (shouldReduceMotion()) {\n resolve();\n } else {\n el.ontransitionend = () => {\n resolve();\n el.ontransitionend = null;\n };\n }\n });\n}\n","@use '@swisspost/design-system-styles/basics';\n@use '@swisspost/design-system-styles/components/accordion';\n@use '@swisspost/design-system-styles/components/transitions';\n\n:host {\n display: block;\n}\n","import { Component, Element, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { checkOneOf, checkType, getElementHeight, onTransitionEnd } from '../../utils';\n\nlet nextId = 0;\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private collapsibleElement: HTMLElement;\n private isLoaded = false;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() collapseClasses: string;\n @State() collapseHeight: string | null = null;\n @State() collapsibleId: string;\n @State() hasHeader: boolean;\n @State() headingTag: string | undefined;\n @State() isOpen = true;\n @State() onAccordionButtonClick = () => this.toggle();\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkType(newValue, 'boolean', 'The post-collapsible \"collapsed\" prop should be a boolean.');\n\n if (!this.isLoaded) {\n this.isOpen = !newValue;\n this.collapseClasses = this.getCollapseClasses();\n } else {\n setTimeout(() => {\n this.toggle(!newValue);\n });\n }\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: number = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkOneOf(\n newValue,\n [ 1, 2, 3, 4, 5, 6 ],\n 'The post-collapsible element requires a heading level between 1 and 6.',\n );\n\n this.headingTag = `h${newValue}`;\n }\n\n componentWillLoad() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n if (!this.hasHeader) {\n console.warn('Be sure to bind the post-collapsible to its control using aria-controls and aria-expanded attributes. More information here: https://getbootstrap.com/docs/5.2/components/collapse/#accessibility');\n }\n\n this.collapsibleId = this.host.id || `post-collapsible-${nextId++}`;\n this.collapseClasses = this.getCollapseClasses();\n }\n\n componentDidLoad() {\n this.isLoaded = true;\n this.collapsibleElement = this.host.shadowRoot.querySelector(`#${this.collapsibleId}--collapse`);\n }\n\n /**\n * Triggers the collapse programmatically.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open !== this.isOpen) {\n this.isOpen = !this.isOpen;\n\n this.startTransition();\n\n await onTransitionEnd(this.collapsibleElement).then(() => {\n this.collapseHeight = null;\n this.collapseClasses = this.getCollapseClasses();\n });\n\n return this.isOpen;\n }\n }\n\n private startTransition() {\n const expandedHeight = getElementHeight(this.collapsibleElement, 'show');\n\n this.collapseHeight = `${this.isOpen ? 0 : expandedHeight}px`;\n this.collapseClasses = 'collapsing';\n\n setTimeout(() => {\n this.collapseHeight = `${this.isOpen ? expandedHeight : 0}px`;\n }, 50);\n }\n\n private getCollapseClasses() {\n return this.isOpen ? 'collapse show' : 'collapse';\n }\n\n render() {\n if (!this.hasHeader) {\n return (\n <div\n id={`${this.collapsibleId}--collapse`}\n class={this.collapseClasses}\n style={{ height: this.collapseHeight }}\n >\n <slot/>\n </div>\n );\n }\n\n return (\n <div class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.collapsibleId}--header`}>\n <button\n class={`accordion-button ${this.isOpen ? '' : 'collapsed'}`}\n type=\"button\"\n aria-expanded={`${this.isOpen}`}\n aria-controls={`${this.collapsibleId}--collapse`}\n onClick={this.onAccordionButtonClick}\n >\n <slot name=\"header\"/>\n </button>\n </this.headingTag>\n <div\n id={`${this.collapsibleId}--collapse`}\n class={`accordion-collapse ${this.collapseClasses}`}\n style={{ height: this.collapseHeight }}\n aria-labelledby={`${this.collapsibleId}--header`}\n >\n <div class=\"accordion-body\">\n <slot/>\n </div>\n </div>\n </div>\n );\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as i,H as n}from"./p-f214c52a.js";import{c as s,a as o}from"./p-f549b3fc.js";const e=[undefined,null,""];function a(t){return(...i)=>{const n=i[0];if(!e.some((t=>t===n)))t(...i)}}const l=a(o);const r=a(s);const h=":host{display:inline-block;width:1em;vertical-align:-0.15em}svg{display:block;width:100%;fill:currentColor}:host([flip-h]) svg{scale:-1 1}:host([flip-v]) svg{scale:1 -1}:host([flip-h][flip-v]) svg{scale:-1}:host([animation]) svg{transform-origin:center}:host([animation=cylon]) svg{animation:icon-animation-cylon 0.75s ease-in-out infinite alternate}:host([animation=cylon-vertical]) svg{animation:icon-animation-cylon-vertical 0.75s ease-in-out infinite alternate}:host([animation=spin]) svg{animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]) svg{animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]) svg{animation:icon-animation-fade 0.75s ease-in-out infinite alternate}:host([animation=throb]) svg{animation:icon-animation-throb 0.75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:0.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:0.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}";const c="https://unpkg.com/@swisspost/design-system-icons/public/post-icons";const m=["cylon","cylon-vertical","spin","spin-reverse","fade","throb"];const d=class{constructor(i){t(this,i);this.svgSource='<svg viewBox="0 0 16 16"></svg>';this.svgOutput=undefined;this.animation=undefined;this.base=undefined;this.flipH=undefined;this.flipV=undefined;this.name=undefined;this.rotate=undefined;this.scale=undefined}validateAnimation(t=this.animation){if(t!==undefined)l(t,m,`The post-icon "animation" prop requires one of the following values: ${m.join(", ")}.`)}validateBase(t=this.base){r(t,"string",'The post-icon "base" prop should be a string.')}validateFlipH(t=this.flipH){r(t,"boolean",'The post-icon "flipH" prop should be a boolean.')}validateFlipV(t=this.flipV){r(t,"boolean",'The post-icon "flipV" prop should be a boolean.')}validateName(t=this.name){s(t,"string",'The post-icon "name" prop should be a string.')}validateRotate(t=this.rotate){r(t,"number",'The post-icon "rotate" prop should be a number.')}validateScale(t=this.scale){r(t,"number",'The post-icon "scale" prop should be a number.')}connectedCallback(){var t;let i;const n=document.head.querySelector('meta[name="design-system-settings"][data-post-icon-base]');if(this.base){i=this.base}else if(n){i=n.getAttribute("data-post-icon-base")}else{i=c}this.path=this.getPath(i);this.svgSource=(t=window.localStorage.getItem(`post-icon-${this.name}`))!==null&&t!==void 0?t:this.svgSource}componentWillLoad(){this.validateAnimation();this.validateBase();this.validateFlipH();this.validateFlipV();this.validateName();this.validateRotate();this.validateScale();this.fetchSVG()}componentWillRender(){const t=Object.entries({scale:this.scale&&!isNaN(Number(this.scale))?`${this.scale}`:null,rotate:this.rotate&&!isNaN(Number(this.rotate))?`${this.rotate}deg`:null}).filter((([t,i])=>i!==null)).map((([t,i])=>`${t}: ${i}`)).join(";");const i=document.createElement("div");i.innerHTML=this.svgSource;const n=i.querySelector("svg");n.setAttribute("style",t);this.svgOutput=i.innerHTML}fetchSVG(){fetch(this.path).then((t=>t.text())).then((t=>{const i=t.match(/^<svg\b([\s\S]*)><\/svg>/);if(i!==null){this.svgSource=i[0];window.localStorage.setItem(`post-icon-${this.name}`,this.svgSource)}else{this.initialPath=this.path;this.path=this.getPath(c);if(this.initialPath!==this.path){console.warn(`Warning in <post-icon/>: The content on the path "${this.path}" seems to be no svg-only content. We'll gonna try to load the icon from the cdn.`);this.fetchSVG()}else{console.error(`Error in <post-icon/>: Could not load the svg on the path "${this.initialPath}"!`)}}})).catch((t=>{console.log(t)}))}getPath(t){return new URL([...t.split("/"),`${this.name}.svg#icon`].join("/"),window.location.origin).toString()}render(){return i(n,null,i("div",{innerHTML:this.svgOutput}))}static get watchers(){return{animation:["validateAnimation"],base:["validateBase"],flipH:["validateFlipH"],flipV:["validateFlipV"],name:["validateName"],rotate:["validateRotate"],scale:["validateScale"]}}};d.style=h;export{d as post_icon};
2
+ //# sourceMappingURL=p-416f1e74.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EMPTY_VALUES","undefined","emptyOr","check","args","value","some","v","checkEmptyOrOneOf","checkOneOf","checkEmptyOrType","checkType","postIconCss","CDN_URL","ANIMATION_KEYS","PostIcon","this","svgSource","validateAnimation","newValue","animation","join","validateBase","base","validateFlipH","flipH","validateFlipV","flipV","validateName","name","validateRotate","rotate","validateScale","scale","connectedCallback","basePath","metaBase","document","head","querySelector","getAttribute","path","getPath","_a","window","localStorage","getItem","componentWillLoad","fetchSVG","componentWillRender","svgStyles","Object","entries","isNaN","Number","filter","_key","map","key","helperElement","createElement","innerHTML","svgElement","setAttribute","svgOutput","fetch","then","response","text","textResponse","match","setItem","initialPath","console","warn","error","catch","log","URL","split","location","origin","toString","render","h","Host"],"sources":["./src/utils/property-checkers/empty-or.ts","./src/utils/property-checkers/index.ts","./src/components/post-icon/post-icon.scss?tag=post-icon&encapsulation=shadow","./src/components/post-icon/post-icon.tsx"],"sourcesContent":["const EMPTY_VALUES = [undefined, null, ''];\n\nexport function emptyOr<T extends unknown[]>(check: (...args: T) => void) {\n return (...args: T) => {\n const value = args[0];\n if (!EMPTY_VALUES.some(v => v === value)) check(...args);\n };\n}\n","import { emptyOr } from './empty-or';\nimport { checkOneOf } from './check-one-of';\nimport { checkType } from './check-type';\n\nexport const checkEmptyOrOneOf = emptyOr(checkOneOf);\nexport const checkEmptyOrType = emptyOr(checkType);\n\nexport * from './check-one-of';\nexport * from './check-type';\n","@use 'sass:map';\n\n$post-icon-animations: (\n 'cylon': icon-animation-cylon .75s ease-in-out infinite alternate,\n 'cylon-vertical': icon-animation-cylon-vertical .75s ease-in-out infinite alternate,\n 'spin': icon-animation-spin 2s linear infinite normal,\n 'spin-reverse': icon-animation-spin 2s linear infinite reverse,\n 'fade': icon-animation-fade .75s ease-in-out infinite alternate,\n 'throb': icon-animation-throb .75s ease-in-out infinite alternate\n);\n\n:host {\n display: inline-block;\n width: 1em;\n vertical-align: -0.15em;\n}\n\nsvg {\n display: block;\n width: 100%;\n fill: currentColor;\n}\n\n// flip\n\n:host([flip-h]) {\n svg { scale: -1 1; }\n}\n\n:host([flip-v]) {\n svg { scale: 1 -1; }\n}\n\n:host([flip-h][flip-v]) {\n svg { scale: -1; }\n}\n\n// scale\n// done with inline styling\n\n// rotate\n// done with inline styling\n\n// animation\n\n:host([animation]) {\n svg {\n transform-origin: center;\n }\n}\n\n@each $key, $value in $post-icon-animations {\n :host([animation=\"#{$key}\"]) {\n svg {\n animation: $value;\n }\n }\n}\n\n@keyframes icon-animation-cylon {\n from { transform: translateX(-25%) }\n to { transform: translateX(25%) }\n}\n\n@keyframes icon-animation-cylon-vertical {\n from { transform: translateY(25%); }\n to { transform: translateY(-25%); }\n}\n\n@keyframes icon-animation-fade {\n from { opacity: .1; }\n to { opacity: 1; }\n}\n\n@keyframes icon-animation-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(359deg); }\n}\n\n@keyframes icon-animation-throb {\n from {\n opacity: .5;\n transform: scale(0.5);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n","import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\nimport { checkType, checkEmptyOrType, checkEmptyOrOneOf } from '../../utils';\n\nconst CDN_URL = 'https://unpkg.com/@swisspost/design-system-icons/public/post-icons';\nconst ANIMATION_KEYS = [\n 'cylon',\n 'cylon-vertical',\n 'spin',\n 'spin-reverse',\n 'fade',\n 'throb'\n];\n\n/**\n * @class PostIcon - representing a stencil component\n */\n@Component({\n tag: 'post-icon',\n styleUrl: 'post-icon.scss',\n shadow: true,\n})\nexport class PostIcon {\n private initialPath: string;\n private path: string;\n private svgSource = '<svg viewBox=\"0 0 16 16\"></svg>';\n\n @State() svgOutput: string;\n\n /**\n * The name of the animation (`cylon`, `cylon-vertical`, `spin`, `spin-reverse`, `fade`, `throb`).\n */\n @Prop() readonly animation?: string;\n\n @Watch('animation')\n validateAnimation(newValue = this.animation) {\n if (newValue !== undefined) checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon \"animation\" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);\n }\n\n /**\n * The base path, where the icons are located (must be a public url).\n */\n @Prop() readonly base?: string;\n\n @Watch('base')\n validateBase(newValue = this.base) {\n checkEmptyOrType(newValue, 'string', 'The post-icon \"base\" prop should be a string.');\n }\n\n /**\n * When set to `true`, the icon will be flipped horizontally.\n */\n @Prop() readonly flipH?: boolean;\n\n @Watch('flipH')\n validateFlipH(newValue = this.flipH) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipH\" prop should be a boolean.');\n }\n\n /**\n * When set to `true`, the icon will be flipped vertically.\n */\n @Prop() readonly flipV?: boolean;\n\n @Watch('flipV')\n validateFlipV(newValue = this.flipV) {\n checkEmptyOrType(newValue, 'boolean', 'The post-icon \"flipV\" prop should be a boolean.');\n }\n\n /**\n * The name/id of the icon (e.g. 1000, 1001, ...).\n */\n @Prop() readonly name: string;\n\n @Watch('name')\n validateName(newValue = this.name) {\n checkType(newValue, 'string', 'The post-icon \"name\" prop should be a string.');\n }\n\n /**\n * The `number` of degree for the css `rotate` transformation.\n */\n @Prop() readonly rotate?: number;\n\n @Watch('rotate')\n validateRotate(newValue = this.rotate) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"rotate\" prop should be a number.');\n }\n\n /**\n * The `number` for the css `scale` transformation.\n */\n @Prop() readonly scale?: number;\n\n @Watch('scale')\n validateScale(newValue = this.scale) {\n checkEmptyOrType(newValue, 'number', 'The post-icon \"scale\" prop should be a number.');\n }\n\n connectedCallback() {\n // Construct icon path from different possible sources\n let basePath: string;\n const metaBase = document.head.querySelector(\n 'meta[name=\"design-system-settings\"][data-post-icon-base]',\n );\n\n if (this.base) {\n basePath = this.base;\n } else if (metaBase) {\n basePath = metaBase.getAttribute('data-post-icon-base');\n } else {\n basePath = CDN_URL;\n }\n\n this.path = this.getPath(basePath);\n this.svgSource = window.localStorage.getItem(`post-icon-${this.name}`) ?? this.svgSource;\n }\n\n componentWillLoad() {\n this.validateAnimation();\n this.validateBase();\n this.validateFlipH();\n this.validateFlipV();\n this.validateName();\n this.validateRotate();\n this.validateScale();\n\n this.fetchSVG();\n }\n\n componentWillRender() {\n const svgStyles = Object.entries({\n scale: this.scale && !isNaN(Number(this.scale)) ? `${this.scale}` : null,\n rotate: this.rotate && !isNaN(Number(this.rotate)) ? `${this.rotate}deg` : null,\n })\n .filter(([_key, value]) => value !== null)\n .map(([key, value]) => `${key}: ${value}`)\n .join(';');\n\n const helperElement = document.createElement('div');\n helperElement.innerHTML = this.svgSource;\n\n const svgElement = helperElement.querySelector('svg');\n svgElement.setAttribute('style', svgStyles);\n\n this.svgOutput = helperElement.innerHTML;\n }\n\n private fetchSVG() {\n fetch(this.path)\n .then(response => response.text())\n .then(textResponse => {\n const match = textResponse.match(/^<svg\\b([\\s\\S]*)><\\/svg>/);\n\n if (match !== null) {\n this.svgSource = match[0];\n window.localStorage.setItem(`post-icon-${this.name}`, this.svgSource);\n } else {\n this.initialPath = this.path;\n this.path = this.getPath(CDN_URL);\n\n if (this.initialPath !== this.path) {\n console.warn(\n `Warning in <post-icon/>: The content on the path \"${this.path}\" seems to be no svg-only content. We'll gonna try to load the icon from the cdn.`,\n );\n this.fetchSVG();\n } else {\n console.error(\n `Error in <post-icon/>: Could not load the svg on the path \"${this.initialPath}\"!`,\n );\n }\n }\n })\n .catch(error => {\n console.log(error);\n });\n }\n\n private getPath(basePath: string) {\n return new URL(\n [...basePath.split('/'), `${this.name}.svg#icon`].join('/'),\n window.location.origin,\n ).toString();\n }\n\n render() {\n return (\n <Host>\n <div innerHTML={this.svgOutput} />\n </Host>\n );\n }\n}\n"],"mappings":"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"}
@@ -1,3 +1,3 @@
1
1
  const t="post-components";let e;let n;let s=false;let o=false;const c=(t,e="")=>{{return()=>{}}};const l=(t,e)=>{{return()=>{}}};const i="{visibility:hidden}.hydrated{visibility:inherit}";const f={};const r="http://www.w3.org/2000/svg";const u="http://www.w3.org/1999/xhtml";const a=t=>t!=null;const d=t=>{t=typeof t;return t==="object"||t==="function"};function p(t){var e,n,s;return(s=(n=(e=t.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||n===void 0?void 0:n.getAttribute("content"))!==null&&s!==void 0?s:undefined}const h=(t,e,...n)=>{let s=null;let o=false;let c=false;const l=[];const i=e=>{for(let n=0;n<e.length;n++){s=e[n];if(Array.isArray(s)){i(s)}else if(s!=null&&typeof s!=="boolean"){if(o=typeof t!=="function"&&!d(s)){s=String(s)}if(o&&c){l[l.length-1].t+=s}else{l.push(o?y(null,s):s)}c=o}}};i(n);if(e){{const t=e.className||e.class;if(t){e.class=typeof t!=="object"?t:Object.keys(t).filter((e=>t[e])).join(" ")}}}if(typeof t==="function"){return t(e===null?{}:e,l,w)}const f=y(t,null);f.o=e;if(l.length>0){f.l=l}return f};const y=(t,e)=>{const n={i:0,u:t,t:e,p:null,l:null};{n.o=null}return n};const m={};const $=t=>t&&t.u===m;const w={forEach:(t,e)=>t.map(b).forEach(e),map:(t,e)=>t.map(b).map(e).map(g)};const b=t=>({vattrs:t.o,vchildren:t.l,vkey:t.h,vname:t.m,vtag:t.u,vtext:t.t});const g=t=>{if(typeof t.vtag==="function"){const e=Object.assign({},t.vattrs);if(t.vkey){e.key=t.vkey}if(t.vname){e.name=t.vname}return h(t.vtag,e,...t.vchildren||[])}const e=y(t.vtag,t.vtext);e.o=t.vattrs;e.l=t.vchildren;e.h=t.vkey;e.m=t.vname;return e};const v=(t,e)=>{if(t!=null&&!d(t)){if(e&4){return t==="false"?false:t===""||!!t}if(e&2){return parseFloat(t)}if(e&1){return String(t)}return t}return t};const S=t=>lt(t).$;const j=(t,e,n)=>{const s=mt.ce(e,n);t.dispatchEvent(s);return s};const O=new WeakMap;const k=(t,e,n)=>{let s=pt.get(t);if(wt&&n){s=s||new CSSStyleSheet;if(typeof s==="string"){s=e}else{s.replaceSync(e)}}else{s=e}pt.set(t,s)};const C=(t,e,n,s)=>{var o;let c=x(e);const l=pt.get(c);t=t.nodeType===11?t:yt;if(l){if(typeof l==="string"){t=t.head||t;let e=O.get(t);let n;if(!e){O.set(t,e=new Set)}if(!e.has(c)){{{n=yt.createElement("style");n.innerHTML=l}const e=(o=mt.g)!==null&&o!==void 0?o:p(yt);if(e!=null){n.setAttribute("nonce",e)}t.insertBefore(n,t.querySelector("link"))}if(e){e.add(c)}}}else if(!t.adoptedStyleSheets.includes(l)){t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]}}return c};const M=t=>{const e=t.v;const n=t.$;const s=e.i;const o=c("attachStyles",e.S);const l=C(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);if(s&10){n["s-sc"]=l;n.classList.add(l+"-h")}o()};const x=(t,e)=>"sc-"+t.S;const P=(t,e,n,s,o,c)=>{if(n!==s){let l=rt(t,e);let i=e.toLowerCase();if(e==="class"){const e=t.classList;const o=L(n);const c=L(s);e.remove(...o.filter((t=>t&&!c.includes(t))));e.add(...c.filter((t=>t&&!o.includes(t))))}else if(e==="style"){{for(const e in n){if(!s||s[e]==null){if(e.includes("-")){t.style.removeProperty(e)}else{t.style[e]=""}}}}for(const e in s){if(!n||s[e]!==n[e]){if(e.includes("-")){t.style.setProperty(e,s[e])}else{t.style[e]=s[e]}}}}else if(!l&&e[0]==="o"&&e[1]==="n"){if(e[2]==="-"){e=e.slice(3)}else if(rt(ht,i)){e=i.slice(2)}else{e=i[2]+e.slice(3)}if(n){mt.rel(t,e,n,false)}if(s){mt.ael(t,e,s,false)}}else{const i=d(s);if((l||i&&s!==null)&&!o){try{if(!t.tagName.includes("-")){const o=s==null?"":s;if(e==="list"){l=false}else if(n==null||t[e]!=o){t[e]=o}}else{t[e]=s}}catch(t){}}if(s==null||s===false){if(s!==false||t.getAttribute(e)===""){{t.removeAttribute(e)}}}else if((!l||c&4||o)&&!i){s=s===true?"":s;{t.setAttribute(e,s)}}}}};const E=/\s/;const L=t=>!t?[]:t.split(E);const U=(t,e,n,s)=>{const o=e.p.nodeType===11&&e.p.host?e.p.host:e.p;const c=t&&t.o||f;const l=e.o||f;{for(s in c){if(!(s in l)){P(o,s,c[s],undefined,n,e.i)}}}for(s in l){P(o,s,c[s],l[s],n,e.i)}};const W=(t,n,o,c)=>{const l=n.l[o];let i=0;let f;let d;{if(!s){s=l.u==="svg"}f=l.p=yt.createElementNS(s?r:u,l.u);if(s&&l.u==="foreignObject"){s=false}{U(null,l,s)}if(a(e)&&f["s-si"]!==e){f.classList.add(f["s-si"]=e)}if(l.l){for(i=0;i<l.l.length;++i){d=W(t,l,i);if(d){f.appendChild(d)}}}{if(l.u==="svg"){s=false}else if(f.tagName==="foreignObject"){s=true}}}return f};const N=(t,e,s,o,c,l)=>{let i=t;let f;if(i.shadowRoot&&i.tagName===n){i=i.shadowRoot}for(;c<=l;++c){if(o[c]){f=W(null,s,c);if(f){o[c].p=f;i.insertBefore(f,e)}}}};const R=(t,e,n,s,o)=>{for(;e<=n;++e){if(s=t[e]){o=s.p;o.remove()}}};const T=(t,e,n,s)=>{let o=0;let c=0;let l=e.length-1;let i=e[0];let f=e[l];let r=s.length-1;let u=s[0];let a=s[r];let d;while(o<=l&&c<=r){if(i==null){i=e[++o]}else if(f==null){f=e[--l]}else if(u==null){u=s[++c]}else if(a==null){a=s[--r]}else if(A(i,u)){F(i,u);i=e[++o];u=s[++c]}else if(A(f,a)){F(f,a);f=e[--l];a=s[--r]}else if(A(i,a)){F(i,a);t.insertBefore(i.p,f.p.nextSibling);i=e[++o];a=s[--r]}else if(A(f,u)){F(f,u);t.insertBefore(f.p,i.p);f=e[--l];u=s[++c]}else{{d=W(e&&e[c],n,c);u=s[++c]}if(d){{i.p.parentNode.insertBefore(d,i.p)}}}}if(o>l){N(t,s[r+1]==null?null:s[r+1].p,n,s,c,r)}else if(c>r){R(e,o,l)}};const A=(t,e)=>{if(t.u===e.u){return true}return false};const F=(t,e)=>{const n=e.p=t.p;const o=t.l;const c=e.l;const l=e.u;{{s=l==="svg"?true:l==="foreignObject"?false:s}{if(l==="slot");else{U(t,e,s)}}if(o!==null&&c!==null){T(n,o,e,c)}else if(c!==null){N(n,null,e,c,0,c.length-1)}else if(o!==null){R(o,0,o.length-1)}if(s&&l==="svg"){s=false}}};const H=(t,s)=>{const o=t.$;const c=t.j||y(null,null);const l=$(s)?s:h(null,null,s);n=o.tagName;l.u=null;l.i|=4;t.j=l;l.p=c.p=o.shadowRoot||o;{e=o["s-sc"]}F(c,l)};const q=(t,e)=>{if(e&&!t.O&&e["s-p"]){e["s-p"].push(new Promise((e=>t.O=e)))}};const D=(t,e)=>{{t.i|=16}if(t.i&4){t.i|=512;return}q(t,t.k);const n=()=>I(t,e);return kt(n)};const I=(t,e)=>{const n=c("scheduleUpdate",t.v.S);const s=t.C;let o;if(e){{o=G(s,"componentWillLoad")}}{o=J(o,(()=>G(s,"componentWillRender")))}n();return J(o,(()=>V(t,s,e)))};const V=async(t,e,n)=>{const s=t.$;const o=c("update",t.v.S);const l=s["s-rc"];if(n){M(t)}const i=c("render",t.v.S);{_(t,e)}if(l){l.map((t=>t()));s["s-rc"]=undefined}i();o();{const e=s["s-p"];const n=()=>z(t);if(e.length===0){n()}else{Promise.all(e).then(n);t.i|=4;e.length=0}}};const _=(t,e,n)=>{try{e=e.render();{t.i&=~16}{t.i|=2}{{{H(t,e)}}}}catch(e){ut(e,t.$)}return null};const z=t=>{const e=t.v.S;const n=t.$;const s=c("postUpdate",e);const o=t.C;const l=t.k;if(!(t.i&64)){t.i|=64;{K(n)}{G(o,"componentDidLoad")}s();{t.M(n);if(!l){B()}}}else{s()}{t.P(n)}{if(t.O){t.O();t.O=undefined}if(t.i&512){Ot((()=>D(t,false)))}t.i&=~(4|512)}};const B=e=>{{K(yt.documentElement)}Ot((()=>j(ht,"appload",{detail:{namespace:t}})))};const G=(t,e,n)=>{if(t&&t[e]){try{return t[e](n)}catch(t){ut(t)}}return undefined};const J=(t,e)=>t&&t.then?t.then(e):e();const K=t=>t.classList.add("hydrated");const Q=(t,e)=>lt(t).L.get(e);const X=(t,e,n,s)=>{const o=lt(t);const c=o.$;const l=o.L.get(e);const i=o.i;const f=o.C;n=v(n,s.U[e][0]);const r=Number.isNaN(l)&&Number.isNaN(n);const u=n!==l&&!r;if((!(i&8)||l===undefined)&&u){o.L.set(e,n);if(f){if(s.W&&i&128){const t=s.W[e];if(t){t.map((t=>{try{f[t](n,l,e)}catch(t){ut(t,c)}}))}}if((i&(2|16))===2){D(o,false)}}}};const Y=(t,e,n)=>{if(e.U){if(t.watchers){e.W=t.watchers}const s=Object.entries(e.U);const o=t.prototype;s.map((([t,[s]])=>{if(s&31||n&2&&s&32){Object.defineProperty(o,t,{get(){return Q(this,t)},set(n){X(this,t,n,e)},configurable:true,enumerable:true})}else if(n&1&&s&64){Object.defineProperty(o,t,{value(...e){const n=lt(this);return n.N.then((()=>n.C[t](...e)))}})}}));if(n&1){const e=new Map;o.attributeChangedCallback=function(t,n,s){mt.jmp((()=>{const n=e.get(t);if(this.hasOwnProperty(n)){s=this[n];delete this[n]}else if(o.hasOwnProperty(n)&&typeof this[n]==="number"&&this[n]==s){return}this[n]=s===null&&typeof this[n]==="boolean"?false:s}))};t.observedAttributes=s.filter((([t,e])=>e[0]&15)).map((([t,n])=>{const s=n[1]||t;e.set(s,t);return s}))}}return t};const Z=async(t,e,n,s,o)=>{if((e.i&32)===0){{e.i|=32;o=dt(n);if(o.then){const t=l();o=await o;t()}if(!o.isProxied){{n.W=o.watchers}Y(o,n,2);o.isProxied=true}const t=c("createInstance",n.S);{e.i|=8}try{new o(e)}catch(t){ut(t)}{e.i&=~8}{e.i|=128}t();tt(e.C)}if(o.style){let t=o.style;const e=x(n);if(!pt.has(e)){const s=c("registerStyles",n.S);k(e,t,!!(n.i&1));s()}}}const i=e.k;const f=()=>D(e,true);if(i&&i["s-rc"]){i["s-rc"].push(f)}else{f()}};const tt=t=>{{G(t,"connectedCallback")}};const et=t=>{if((mt.i&1)===0){const e=lt(t);const n=e.v;const s=c("connectedCallback",n.S);if(!(e.i&1)){e.i|=1;{let n=t;while(n=n.parentNode||n.host){if(n["s-p"]){q(e,e.k=n);break}}}if(n.U){Object.entries(n.U).map((([e,[n]])=>{if(n&31&&t.hasOwnProperty(e)){const n=t[e];delete t[e];t[e]=n}}))}{Z(t,e,n)}}else{tt(e.C)}s()}};const nt=t=>{if((mt.i&1)===0){lt(t)}};const st=(t,e={})=>{var n;const s=c();const o=[];const l=e.exclude||[];const f=ht.customElements;const r=yt.head;const u=r.querySelector("meta[charset]");const a=yt.createElement("style");const d=[];let h;let y=true;Object.assign(mt,e);mt.R=new URL(e.resourcesUrl||"./",yt.baseURI).href;t.map((t=>{t[1].map((e=>{const n={i:e[0],S:e[1],U:e[2],T:e[3]};{n.U=e[2]}{n.W={}}const s=n.S;const c=class extends HTMLElement{constructor(t){super(t);t=this;ft(t,n);if(n.i&1){{{t.attachShadow({mode:"open"})}}}}connectedCallback(){if(h){clearTimeout(h);h=null}if(y){d.push(this)}else{mt.jmp((()=>et(this)))}}disconnectedCallback(){mt.jmp((()=>nt(this)))}componentOnReady(){return lt(this).A}};n.F=t[0];if(!l.includes(s)&&!f.get(s)){o.push(s);f.define(s,Y(c,n,1))}}))}));{a.innerHTML=o+i;a.setAttribute("data-styles","");const t=(n=mt.g)!==null&&n!==void 0?n:p(yt);if(t!=null){a.setAttribute("nonce",t)}r.insertBefore(a,u?u.nextSibling:r.firstChild)}y=false;if(d.length){d.map((t=>t.connectedCallback()))}else{{mt.jmp((()=>h=setTimeout(B,30)))}}s()};const ot=t=>mt.g=t;const ct=new WeakMap;const lt=t=>ct.get(t);const it=(t,e)=>ct.set(e.C=t,e);const ft=(t,e)=>{const n={i:0,$:t,v:e,L:new Map};{n.N=new Promise((t=>n.P=t))}{n.A=new Promise((t=>n.M=t));t["s-p"]=[];t["s-rc"]=[]}return ct.set(t,n)};const rt=(t,e)=>e in t;const ut=(t,e)=>(0,console.error)(t,e);const at=new Map;const dt=(t,e,n)=>{const s=t.S.replace(/-/g,"_");const o=t.F;const c=at.get(o);if(c){return c[s]}
2
2
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/return import(`./${o}.entry.js${""}`).then((t=>{{at.set(o,t)}return t[s]}),ut)};const pt=new Map;const ht=typeof window!=="undefined"?window:{};const yt=ht.document||{head:{}};const mt={i:0,R:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,s)=>t.addEventListener(e,n,s),rel:(t,e,n,s)=>t.removeEventListener(e,n,s),ce:(t,e)=>new CustomEvent(t,e)};const $t=t=>Promise.resolve(t);const wt=(()=>{try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(t){}return false})();const bt=[];const gt=[];const vt=(t,e)=>n=>{t.push(n);if(!o){o=true;if(e&&mt.i&4){Ot(jt)}else{mt.raf(jt)}}};const St=t=>{for(let e=0;e<t.length;e++){try{t[e](performance.now())}catch(t){ut(t)}}t.length=0};const jt=()=>{St(bt);{St(gt);if(o=bt.length>0){mt.raf(jt)}}};const Ot=t=>$t().then(t);const kt=vt(gt,true);export{m as H,st as b,S as g,h,$t as p,it as r,ot as s};
3
- //# sourceMappingURL=p-a93114b9.js.map
3
+ //# sourceMappingURL=p-f214c52a.js.map