@rededor/cura 0.4.4 → 0.4.6

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 (95) hide show
  1. package/dist/assets/icons/iconset-default-list.ts +1 -1
  2. package/dist/assets/icons/iconset-default-tmp.svg +942 -0
  3. package/dist/assets/icons/iconset-default.svg +1 -1
  4. package/dist/cjs/{app-globals-858f45bf.js → app-globals-11fb6b23.js} +4 -4
  5. package/dist/cjs/{app-globals-858f45bf.js.map → app-globals-11fb6b23.js.map} +1 -1
  6. package/dist/cjs/cura-button_10.cjs.entry.js +19 -10
  7. package/dist/cjs/cura-button_10.cjs.entry.js.map +1 -1
  8. package/dist/cjs/cura.cjs.js +3 -3
  9. package/dist/cjs/{index-29633529.js → index-0e874533.js} +3 -247
  10. package/dist/cjs/index-0e874533.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +3 -3
  12. package/dist/collection/api/theme-presets/static.js +3 -3
  13. package/dist/collection/api/theme-presets/static.js.map +1 -1
  14. package/dist/collection/assets/icons/iconset-default-list.js +1 -1
  15. package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
  16. package/dist/collection/assets/icons/iconset-default-tmp.svg +942 -0
  17. package/dist/collection/assets/icons/iconset-default.svg +1 -1
  18. package/dist/collection/assets-raw/icons/default/airdrop.svg +6 -0
  19. package/dist/collection/assets-raw/icons/default/doc.svg +5 -2
  20. package/dist/collection/assets-raw/icons/default/maintenance.svg +4 -0
  21. package/dist/collection/assets-raw/icons/default/profile.svg +2 -2
  22. package/dist/collection/assets-raw/icons/default/profileCircle.svg +4 -0
  23. package/dist/collection/assets-raw/icons/default/scheduleCheck.svg +8 -0
  24. package/dist/collection/assets-raw/icons/default/telegram.svg +3 -0
  25. package/dist/collection/assets-raw/icons/default/twitter.svg +3 -1
  26. package/dist/collection/components/buttons/cura-button/cura-button.stories.js +122 -0
  27. package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -0
  28. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +31 -20
  29. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +43 -9
  30. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
  31. package/dist/collection/stories/Button.js +21 -0
  32. package/dist/collection/stories/Button.stories.js +50 -0
  33. package/dist/collection/stories/Header.js +47 -0
  34. package/dist/collection/stories/Header.stories.js +28 -0
  35. package/dist/collection/stories/Page.js +94 -0
  36. package/dist/collection/stories/Page.stories.js +27 -0
  37. package/dist/collection/stories/assets/accessibility.svg +5 -0
  38. package/dist/collection/stories/assets/discord.svg +15 -0
  39. package/dist/collection/stories/assets/github.svg +3 -0
  40. package/dist/collection/stories/assets/tutorials.svg +12 -0
  41. package/dist/collection/stories/assets/youtube.svg +4 -0
  42. package/dist/components/cura-icons-view.js +1 -1
  43. package/dist/components/cura-icons-view.js.map +1 -1
  44. package/dist/components/cura-paragraph.js +20 -9
  45. package/dist/components/cura-paragraph.js.map +1 -1
  46. package/dist/components/index.js +3 -3
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/cura/cura.esm.js +1 -1
  49. package/dist/cura/cura.esm.js.map +1 -1
  50. package/dist/cura/cura.js +1 -1
  51. package/dist/cura/{p-aa9ad33b.system.js → p-0bb24006.system.js} +2 -2
  52. package/dist/cura/{p-aa9ad33b.system.js.map → p-0bb24006.system.js.map} +1 -1
  53. package/dist/cura/{p-deafb1b5.js → p-0e6b48da.js} +2 -2
  54. package/dist/cura/{p-deafb1b5.js.map → p-0e6b48da.js.map} +1 -1
  55. package/dist/cura/{p-07674ea7.system.js → p-19176c44.system.js} +2 -2
  56. package/dist/cura/{p-07674ea7.system.js.map → p-19176c44.system.js.map} +1 -1
  57. package/dist/cura/p-a84ae34f.system.js +3 -0
  58. package/dist/cura/p-a84ae34f.system.js.map +1 -0
  59. package/dist/cura/{p-452d4f72.entry.js → p-b7e3230a.entry.js} +2 -2
  60. package/dist/cura/{p-452d4f72.entry.js.map → p-b7e3230a.entry.js.map} +1 -1
  61. package/dist/cura/p-cbc91ac5.js +3 -0
  62. package/dist/cura/p-cbc91ac5.js.map +1 -0
  63. package/dist/cura/{p-d76958f4.system.entry.js → p-e45582d9.system.entry.js} +2 -2
  64. package/dist/cura/{p-d76958f4.system.entry.js.map → p-e45582d9.system.entry.js.map} +1 -1
  65. package/dist/esm/{app-globals-66a65edd.js → app-globals-5009a324.js} +4 -4
  66. package/dist/esm/{app-globals-66a65edd.js.map → app-globals-5009a324.js.map} +1 -1
  67. package/dist/esm/cura-button_10.entry.js +19 -10
  68. package/dist/esm/cura-button_10.entry.js.map +1 -1
  69. package/dist/esm/cura.js +4 -4
  70. package/dist/esm/{index-e11775ce.js → index-92c824be.js} +3 -247
  71. package/dist/esm/index-92c824be.js.map +1 -0
  72. package/dist/esm/loader.js +4 -4
  73. package/dist/esm-es5/{app-globals-66a65edd.js → app-globals-5009a324.js} +2 -2
  74. package/dist/esm-es5/{app-globals-66a65edd.js.map → app-globals-5009a324.js.map} +1 -1
  75. package/dist/esm-es5/cura-button_10.entry.js +1 -1
  76. package/dist/esm-es5/cura-button_10.entry.js.map +1 -1
  77. package/dist/esm-es5/cura.js +1 -1
  78. package/dist/esm-es5/cura.js.map +1 -1
  79. package/dist/esm-es5/index-92c824be.js +3 -0
  80. package/dist/esm-es5/index-92c824be.js.map +1 -0
  81. package/dist/esm-es5/loader.js +1 -1
  82. package/dist/esm-es5/loader.js.map +1 -1
  83. package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +119 -0
  84. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +7 -2
  85. package/dist/types/components.d.ts +10 -2
  86. package/package.json +15 -3
  87. package/dist/cjs/index-29633529.js.map +0 -1
  88. package/dist/collection/assets-raw/icons/default/profile2.svg +0 -4
  89. package/dist/cura/p-c30e14d5.system.js +0 -3
  90. package/dist/cura/p-c30e14d5.system.js.map +0 -1
  91. package/dist/cura/p-d5990392.js +0 -3
  92. package/dist/cura/p-d5990392.js.map +0 -1
  93. package/dist/esm/index-e11775ce.js.map +0 -1
  94. package/dist/esm-es5/index-e11775ce.js +0 -3
  95. package/dist/esm-es5/index-e11775ce.js.map +0 -1
@@ -30,13 +30,6 @@ const uniqueTime = (key, measureText) => {
30
30
  };
31
31
  }
32
32
  };
33
- const CONTENT_REF_ID = 'r';
34
- const ORG_LOCATION_ID = 'o';
35
- const SLOT_NODE_ID = 's';
36
- const TEXT_NODE_ID = 't';
37
- const HYDRATE_ID = 's-id';
38
- const HYDRATED_STYLE_ID = 'sty-id';
39
- const HYDRATE_CHILD_ID = 'c-id';
40
33
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
41
34
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
42
35
  /**
@@ -174,211 +167,6 @@ const Host = {};
174
167
  * @returns whether it's a Host node or not
175
168
  */
176
169
  const isHost = (node) => node && node.$tag$ === Host;
177
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
178
- const endHydrate = createTime('hydrateClient', tagName);
179
- const shadowRoot = hostElm.shadowRoot;
180
- const childRenderNodes = [];
181
- const slotNodes = [];
182
- const shadowRootNodes = shadowRoot ? [] : null;
183
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
184
- if (!plt.$orgLocNodes$) {
185
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
186
- }
187
- hostElm[HYDRATE_ID] = hostId;
188
- hostElm.removeAttribute(HYDRATE_ID);
189
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
190
- childRenderNodes.map((c) => {
191
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
192
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
193
- const node = c.$elm$;
194
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
195
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
196
- }
197
- if (!shadowRoot) {
198
- node['s-hn'] = tagName;
199
- if (orgLocationNode) {
200
- node['s-ol'] = orgLocationNode;
201
- node['s-ol']['s-nr'] = node;
202
- }
203
- }
204
- plt.$orgLocNodes$.delete(orgLocationId);
205
- });
206
- if (shadowRoot) {
207
- shadowRootNodes.map((shadowRootNode) => {
208
- if (shadowRootNode) {
209
- shadowRoot.appendChild(shadowRootNode);
210
- }
211
- });
212
- }
213
- endHydrate();
214
- };
215
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
216
- let childNodeType;
217
- let childIdSplt;
218
- let childVNode;
219
- let i;
220
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
221
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
222
- if (childNodeType) {
223
- // got the node data from the element's attribute
224
- // `${hostId}.${nodeId}.${depth}.${index}`
225
- childIdSplt = childNodeType.split('.');
226
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
227
- childVNode = {
228
- $flags$: 0,
229
- $hostId$: childIdSplt[0],
230
- $nodeId$: childIdSplt[1],
231
- $depth$: childIdSplt[2],
232
- $index$: childIdSplt[3],
233
- $tag$: node.tagName.toLowerCase(),
234
- $elm$: node,
235
- $attrs$: null,
236
- $children$: null,
237
- $key$: null,
238
- $name$: null,
239
- $text$: null,
240
- };
241
- childRenderNodes.push(childVNode);
242
- node.removeAttribute(HYDRATE_CHILD_ID);
243
- // this is a new child vnode
244
- // so ensure its parent vnode has the vchildren array
245
- if (!parentVNode.$children$) {
246
- parentVNode.$children$ = [];
247
- }
248
- // add our child vnode to a specific index of the vnode's children
249
- parentVNode.$children$[childVNode.$index$] = childVNode;
250
- // this is now the new parent vnode for all the next child checks
251
- parentVNode = childVNode;
252
- if (shadowRootNodes && childVNode.$depth$ === '0') {
253
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
254
- }
255
- }
256
- }
257
- // recursively drill down, end to start so we can remove nodes
258
- for (i = node.childNodes.length - 1; i >= 0; i--) {
259
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
260
- }
261
- if (node.shadowRoot) {
262
- // keep drilling down through the shadow root nodes
263
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
264
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
265
- }
266
- }
267
- }
268
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
269
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
270
- childIdSplt = node.nodeValue.split('.');
271
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
272
- // comment node for either the host id or a 0 host id
273
- childNodeType = childIdSplt[0];
274
- childVNode = {
275
- $flags$: 0,
276
- $hostId$: childIdSplt[1],
277
- $nodeId$: childIdSplt[2],
278
- $depth$: childIdSplt[3],
279
- $index$: childIdSplt[4],
280
- $elm$: node,
281
- $attrs$: null,
282
- $children$: null,
283
- $key$: null,
284
- $name$: null,
285
- $tag$: null,
286
- $text$: null,
287
- };
288
- if (childNodeType === TEXT_NODE_ID) {
289
- childVNode.$elm$ = node.nextSibling;
290
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
291
- childVNode.$text$ = childVNode.$elm$.textContent;
292
- childRenderNodes.push(childVNode);
293
- // remove the text comment since it's no longer needed
294
- node.remove();
295
- if (!parentVNode.$children$) {
296
- parentVNode.$children$ = [];
297
- }
298
- parentVNode.$children$[childVNode.$index$] = childVNode;
299
- if (shadowRootNodes && childVNode.$depth$ === '0') {
300
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
301
- }
302
- }
303
- }
304
- else if (childVNode.$hostId$ === hostId) {
305
- // this comment node is specifcally for this host id
306
- if (childNodeType === SLOT_NODE_ID) {
307
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
308
- childVNode.$tag$ = 'slot';
309
- if (childIdSplt[5]) {
310
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
311
- }
312
- else {
313
- node['s-sn'] = '';
314
- }
315
- node['s-sr'] = true;
316
- if (shadowRootNodes) {
317
- // browser support shadowRoot and this is a shadow dom component
318
- // create an actual slot element
319
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
320
- if (childVNode.$name$) {
321
- // add the slot name attribute
322
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
323
- }
324
- // insert the new slot element before the slot comment
325
- node.parentNode.insertBefore(childVNode.$elm$, node);
326
- // remove the slot comment since it's not needed for shadow
327
- node.remove();
328
- if (childVNode.$depth$ === '0') {
329
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
330
- }
331
- }
332
- slotNodes.push(childVNode);
333
- if (!parentVNode.$children$) {
334
- parentVNode.$children$ = [];
335
- }
336
- parentVNode.$children$[childVNode.$index$] = childVNode;
337
- }
338
- else if (childNodeType === CONTENT_REF_ID) {
339
- // `${CONTENT_REF_ID}.${hostId}`;
340
- if (shadowRootNodes) {
341
- // remove the content ref comment since it's not needed for shadow
342
- node.remove();
343
- }
344
- else {
345
- hostElm['s-cr'] = node;
346
- node['s-cn'] = true;
347
- }
348
- }
349
- }
350
- }
351
- }
352
- else if (parentVNode && parentVNode.$tag$ === 'style') {
353
- const vnode = newVNode(null, node.textContent);
354
- vnode.$elm$ = node;
355
- vnode.$index$ = '0';
356
- parentVNode.$children$ = [vnode];
357
- }
358
- };
359
- const initializeDocumentHydrate = (node, orgLocNodes) => {
360
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
361
- let i = 0;
362
- for (; i < node.childNodes.length; i++) {
363
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
364
- }
365
- if (node.shadowRoot) {
366
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
367
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
368
- }
369
- }
370
- }
371
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
372
- const childIdSplt = node.nodeValue.split('.');
373
- if (childIdSplt[0] === ORG_LOCATION_ID) {
374
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
375
- node.nodeValue = '';
376
- // useful to know if the original location is
377
- // the root light-dom of a shadow dom component
378
- node['s-en'] = childIdSplt[3];
379
- }
380
- }
381
- };
382
170
  /**
383
171
  * Parse a new property value for a given property type.
384
172
  *
@@ -472,12 +260,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
472
260
  rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
473
261
  }
474
262
  if (!appliedStyles.has(scopeId)) {
475
- if (styleContainerNode.host &&
476
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
477
- // This is only happening on native shadow-dom, do not needs CSS var shim
478
- styleElm.innerHTML = style;
479
- }
480
- else {
263
+ {
481
264
  // TODO(STENCIL-659): Remove code implementing the CSS variable shim
482
265
  if (plt.$cssShim$) {
483
266
  // TODO(STENCIL-659): Remove code implementing the CSS variable shim
@@ -536,7 +319,6 @@ const attachStyles = (hostRef) => {
536
319
  endAttachStyles();
537
320
  };
538
321
  const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
539
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
540
322
  /**
541
323
  * Production setAccessor() function based on Preact by
542
324
  * Jason Miller (@developit)
@@ -1881,18 +1663,7 @@ const connectedCallback = (elm) => {
1881
1663
  if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1882
1664
  // first time this component has connected
1883
1665
  hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1884
- let hostId;
1885
1666
  {
1886
- hostId = elm.getAttribute(HYDRATE_ID);
1887
- if (hostId) {
1888
- if (supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1889
- const scopeId = addStyle(elm.shadowRoot, cmpMeta);
1890
- elm.classList.remove(scopeId + '-h', scopeId + '-s');
1891
- }
1892
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1893
- }
1894
- }
1895
- if (!hostId) {
1896
1667
  // initUpdate
1897
1668
  // if the slot polyfill is required we'll need to put some nodes
1898
1669
  // in here to act as original content anchors as we move nodes around
@@ -1909,10 +1680,7 @@ const connectedCallback = (elm) => {
1909
1680
  while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1910
1681
  // climb up the ancestors looking for the first
1911
1682
  // component that hasn't finished its lifecycle update yet
1912
- if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1913
- ancestorComponent.hasAttribute('s-id') &&
1914
- ancestorComponent['s-p']) ||
1915
- ancestorComponent['s-p']) {
1683
+ if (ancestorComponent['s-p']) {
1916
1684
  // we found this components first ancestor component
1917
1685
  // keep a reference to this component's ancestor component
1918
1686
  attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
@@ -1974,22 +1742,10 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1974
1742
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1975
1743
  const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1976
1744
  const deferredConnectedCallbacks = [];
1977
- const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1978
1745
  let appLoadFallback;
1979
1746
  let isBootstrapping = true;
1980
- let i = 0;
1981
1747
  Object.assign(plt, options);
1982
1748
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1983
- {
1984
- // If the app is already hydrated there is not point to disable the
1985
- // async queue. This will improve the first input delay
1986
- plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
1987
- }
1988
- {
1989
- for (; i < styles.length; i++) {
1990
- registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
1991
- }
1992
- }
1993
1749
  lazyBundles.map((lazyBundle) => {
1994
1750
  lazyBundle[1].map((compactMeta) => {
1995
1751
  const cmpMeta = {
@@ -2205,4 +1961,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2205
1961
 
2206
1962
  export { CSS as C, Host as H, promiseResolve as a, bootstrapLazy as b, getElement as g, h, plt as p, registerInstance as r, setNonce as s, win as w };
2207
1963
 
2208
- //# sourceMappingURL=index-e11775ce.js.map
1964
+ //# sourceMappingURL=index-92c824be.js.map