@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
@@ -52,13 +52,6 @@ const uniqueTime = (key, measureText) => {
52
52
  };
53
53
  }
54
54
  };
55
- const CONTENT_REF_ID = 'r';
56
- const ORG_LOCATION_ID = 'o';
57
- const SLOT_NODE_ID = 's';
58
- const TEXT_NODE_ID = 't';
59
- const HYDRATE_ID = 's-id';
60
- const HYDRATED_STYLE_ID = 'sty-id';
61
- const HYDRATE_CHILD_ID = 'c-id';
62
55
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
63
56
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
64
57
  /**
@@ -196,211 +189,6 @@ const Host = {};
196
189
  * @returns whether it's a Host node or not
197
190
  */
198
191
  const isHost = (node) => node && node.$tag$ === Host;
199
- const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
200
- const endHydrate = createTime('hydrateClient', tagName);
201
- const shadowRoot = hostElm.shadowRoot;
202
- const childRenderNodes = [];
203
- const slotNodes = [];
204
- const shadowRootNodes = shadowRoot ? [] : null;
205
- const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
206
- if (!plt.$orgLocNodes$) {
207
- initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
208
- }
209
- hostElm[HYDRATE_ID] = hostId;
210
- hostElm.removeAttribute(HYDRATE_ID);
211
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
212
- childRenderNodes.map((c) => {
213
- const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
214
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
215
- const node = c.$elm$;
216
- if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
217
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
218
- }
219
- if (!shadowRoot) {
220
- node['s-hn'] = tagName;
221
- if (orgLocationNode) {
222
- node['s-ol'] = orgLocationNode;
223
- node['s-ol']['s-nr'] = node;
224
- }
225
- }
226
- plt.$orgLocNodes$.delete(orgLocationId);
227
- });
228
- if (shadowRoot) {
229
- shadowRootNodes.map((shadowRootNode) => {
230
- if (shadowRootNode) {
231
- shadowRoot.appendChild(shadowRootNode);
232
- }
233
- });
234
- }
235
- endHydrate();
236
- };
237
- const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
238
- let childNodeType;
239
- let childIdSplt;
240
- let childVNode;
241
- let i;
242
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
243
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
244
- if (childNodeType) {
245
- // got the node data from the element's attribute
246
- // `${hostId}.${nodeId}.${depth}.${index}`
247
- childIdSplt = childNodeType.split('.');
248
- if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
249
- childVNode = {
250
- $flags$: 0,
251
- $hostId$: childIdSplt[0],
252
- $nodeId$: childIdSplt[1],
253
- $depth$: childIdSplt[2],
254
- $index$: childIdSplt[3],
255
- $tag$: node.tagName.toLowerCase(),
256
- $elm$: node,
257
- $attrs$: null,
258
- $children$: null,
259
- $key$: null,
260
- $name$: null,
261
- $text$: null,
262
- };
263
- childRenderNodes.push(childVNode);
264
- node.removeAttribute(HYDRATE_CHILD_ID);
265
- // this is a new child vnode
266
- // so ensure its parent vnode has the vchildren array
267
- if (!parentVNode.$children$) {
268
- parentVNode.$children$ = [];
269
- }
270
- // add our child vnode to a specific index of the vnode's children
271
- parentVNode.$children$[childVNode.$index$] = childVNode;
272
- // this is now the new parent vnode for all the next child checks
273
- parentVNode = childVNode;
274
- if (shadowRootNodes && childVNode.$depth$ === '0') {
275
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
276
- }
277
- }
278
- }
279
- // recursively drill down, end to start so we can remove nodes
280
- for (i = node.childNodes.length - 1; i >= 0; i--) {
281
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
282
- }
283
- if (node.shadowRoot) {
284
- // keep drilling down through the shadow root nodes
285
- for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
286
- clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
287
- }
288
- }
289
- }
290
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
291
- // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
292
- childIdSplt = node.nodeValue.split('.');
293
- if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
294
- // comment node for either the host id or a 0 host id
295
- childNodeType = childIdSplt[0];
296
- childVNode = {
297
- $flags$: 0,
298
- $hostId$: childIdSplt[1],
299
- $nodeId$: childIdSplt[2],
300
- $depth$: childIdSplt[3],
301
- $index$: childIdSplt[4],
302
- $elm$: node,
303
- $attrs$: null,
304
- $children$: null,
305
- $key$: null,
306
- $name$: null,
307
- $tag$: null,
308
- $text$: null,
309
- };
310
- if (childNodeType === TEXT_NODE_ID) {
311
- childVNode.$elm$ = node.nextSibling;
312
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
313
- childVNode.$text$ = childVNode.$elm$.textContent;
314
- childRenderNodes.push(childVNode);
315
- // remove the text comment since it's no longer needed
316
- node.remove();
317
- if (!parentVNode.$children$) {
318
- parentVNode.$children$ = [];
319
- }
320
- parentVNode.$children$[childVNode.$index$] = childVNode;
321
- if (shadowRootNodes && childVNode.$depth$ === '0') {
322
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
323
- }
324
- }
325
- }
326
- else if (childVNode.$hostId$ === hostId) {
327
- // this comment node is specifcally for this host id
328
- if (childNodeType === SLOT_NODE_ID) {
329
- // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
330
- childVNode.$tag$ = 'slot';
331
- if (childIdSplt[5]) {
332
- node['s-sn'] = childVNode.$name$ = childIdSplt[5];
333
- }
334
- else {
335
- node['s-sn'] = '';
336
- }
337
- node['s-sr'] = true;
338
- if (shadowRootNodes) {
339
- // browser support shadowRoot and this is a shadow dom component
340
- // create an actual slot element
341
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
342
- if (childVNode.$name$) {
343
- // add the slot name attribute
344
- childVNode.$elm$.setAttribute('name', childVNode.$name$);
345
- }
346
- // insert the new slot element before the slot comment
347
- node.parentNode.insertBefore(childVNode.$elm$, node);
348
- // remove the slot comment since it's not needed for shadow
349
- node.remove();
350
- if (childVNode.$depth$ === '0') {
351
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
352
- }
353
- }
354
- slotNodes.push(childVNode);
355
- if (!parentVNode.$children$) {
356
- parentVNode.$children$ = [];
357
- }
358
- parentVNode.$children$[childVNode.$index$] = childVNode;
359
- }
360
- else if (childNodeType === CONTENT_REF_ID) {
361
- // `${CONTENT_REF_ID}.${hostId}`;
362
- if (shadowRootNodes) {
363
- // remove the content ref comment since it's not needed for shadow
364
- node.remove();
365
- }
366
- else {
367
- hostElm['s-cr'] = node;
368
- node['s-cn'] = true;
369
- }
370
- }
371
- }
372
- }
373
- }
374
- else if (parentVNode && parentVNode.$tag$ === 'style') {
375
- const vnode = newVNode(null, node.textContent);
376
- vnode.$elm$ = node;
377
- vnode.$index$ = '0';
378
- parentVNode.$children$ = [vnode];
379
- }
380
- };
381
- const initializeDocumentHydrate = (node, orgLocNodes) => {
382
- if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
383
- let i = 0;
384
- for (; i < node.childNodes.length; i++) {
385
- initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
386
- }
387
- if (node.shadowRoot) {
388
- for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
389
- initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
390
- }
391
- }
392
- }
393
- else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
394
- const childIdSplt = node.nodeValue.split('.');
395
- if (childIdSplt[0] === ORG_LOCATION_ID) {
396
- orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
397
- node.nodeValue = '';
398
- // useful to know if the original location is
399
- // the root light-dom of a shadow dom component
400
- node['s-en'] = childIdSplt[3];
401
- }
402
- }
403
- };
404
192
  /**
405
193
  * Parse a new property value for a given property type.
406
194
  *
@@ -494,12 +282,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
494
282
  rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
495
283
  }
496
284
  if (!appliedStyles.has(scopeId)) {
497
- if (styleContainerNode.host &&
498
- (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
499
- // This is only happening on native shadow-dom, do not needs CSS var shim
500
- styleElm.innerHTML = style;
501
- }
502
- else {
285
+ {
503
286
  // TODO(STENCIL-659): Remove code implementing the CSS variable shim
504
287
  if (plt.$cssShim$) {
505
288
  // TODO(STENCIL-659): Remove code implementing the CSS variable shim
@@ -558,7 +341,6 @@ const attachStyles = (hostRef) => {
558
341
  endAttachStyles();
559
342
  };
560
343
  const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
561
- const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
562
344
  /**
563
345
  * Production setAccessor() function based on Preact by
564
346
  * Jason Miller (@developit)
@@ -1903,18 +1685,7 @@ const connectedCallback = (elm) => {
1903
1685
  if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1904
1686
  // first time this component has connected
1905
1687
  hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1906
- let hostId;
1907
1688
  {
1908
- hostId = elm.getAttribute(HYDRATE_ID);
1909
- if (hostId) {
1910
- if (supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1911
- const scopeId = addStyle(elm.shadowRoot, cmpMeta);
1912
- elm.classList.remove(scopeId + '-h', scopeId + '-s');
1913
- }
1914
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1915
- }
1916
- }
1917
- if (!hostId) {
1918
1689
  // initUpdate
1919
1690
  // if the slot polyfill is required we'll need to put some nodes
1920
1691
  // in here to act as original content anchors as we move nodes around
@@ -1931,10 +1702,7 @@ const connectedCallback = (elm) => {
1931
1702
  while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1932
1703
  // climb up the ancestors looking for the first
1933
1704
  // component that hasn't finished its lifecycle update yet
1934
- if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1935
- ancestorComponent.hasAttribute('s-id') &&
1936
- ancestorComponent['s-p']) ||
1937
- ancestorComponent['s-p']) {
1705
+ if (ancestorComponent['s-p']) {
1938
1706
  // we found this components first ancestor component
1939
1707
  // keep a reference to this component's ancestor component
1940
1708
  attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
@@ -1996,22 +1764,10 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1996
1764
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1997
1765
  const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1998
1766
  const deferredConnectedCallbacks = [];
1999
- const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2000
1767
  let appLoadFallback;
2001
1768
  let isBootstrapping = true;
2002
- let i = 0;
2003
1769
  Object.assign(plt, options);
2004
1770
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2005
- {
2006
- // If the app is already hydrated there is not point to disable the
2007
- // async queue. This will improve the first input delay
2008
- plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2009
- }
2010
- {
2011
- for (; i < styles.length; i++) {
2012
- registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2013
- }
2014
- }
2015
1771
  lazyBundles.map((lazyBundle) => {
2016
1772
  lazyBundle[1].map((compactMeta) => {
2017
1773
  const cmpMeta = {
@@ -2236,4 +1992,4 @@ exports.registerInstance = registerInstance;
2236
1992
  exports.setNonce = setNonce;
2237
1993
  exports.win = win;
2238
1994
 
2239
- //# sourceMappingURL=index-29633529.js.map
1995
+ //# sourceMappingURL=index-0e874533.js.map