@wow-two-beta/fe 0.0.46 → 0.0.47

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.
@@ -46,9 +46,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  role: "img",
47
47
  "aria-label": label.value
48
48
  }, rest.value, { class: classes.value }), [
49
- (openBlock(true), createElementBlock(Fragment, null, renderList(dots.value, (dot) => {
49
+ (openBlock(true), createElementBlock(Fragment, null, renderList(dots.value, (dot, slot) => {
50
50
  return openBlock(), createElementBlock("span", mergeProps({
51
- key: dot.position,
51
+ key: slot,
52
52
  class: dotClasses(dot),
53
53
  "aria-hidden": "true"
54
54
  }, { ref_for: true }, { "data-dot": "", "data-active": dot.isActive || void 0, "data-edge": dot.edge }), null, 16);
@@ -1 +1 @@
1
- {"version":3,"file":"DotsIndicator.vue.js","sources":["../../../../src/presentation/display/dotsIndicator/DotsIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DotsIndicatorProps {\n /** The total number of items the dots stand for. */\n readonly count: number;\n\n /** The current item, zero-based; clamped into range. */\n readonly index: number;\n\n /** The most dots shown; every item when there are fewer. Default 5. */\n readonly visibleCount?: number;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { useLocale } from '../../../foundation/i18n';\nimport { cn } from '../../../foundation/styles';\nimport { dotsIndicatorWindowOf, type DotsIndicatorDot } from './DotsIndicatorWindow';\n\nconst locale = useLocale();\n\n/**\n * Renders a row of dots for a position in a longer series, such as the image a card shows. It calculates its own\n * window: with more items than `visibleCount` it shows that many dots, keeps the current item's dot highlighted on\n * the centre while it can, slides along as `index` moves, and draws the edge dot smaller when more items lie beyond it.\n *\n * The dots are drawn in the current text colour, so a text colour utility such as `text-white` on a photograph colours\n * them; the current dot is solid and the rest are faded. It is presentational: the row is one image named by its\n * position, `3 of 10`.\n */\ndefineOptions({ name: 'DotsIndicator', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<DotsIndicatorProps>(), { visibleCount: 5 });\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\nconst dots = computed(() => dotsIndicatorWindowOf(props.count, props.index, props.visibleCount));\nconst current = computed(() => dots.value.find((dot) => dot.isActive)?.position ?? 0);\nconst label = computed(() =>\n locale.t(\n 'DotsIndicator.position',\n { index: current.value + 1, total: Math.max(0, props.count) },\n '{index} of {total}',\n ),\n);\n\nconst classes = computed(() => cn('inline-flex items-center gap-1', attrs.class as string | undefined));\n\n/** One dot's size and fade: the current one solid, a window edge with more beyond it small and faint. */\nfunction dotClasses(dot: DotsIndicatorDot): string {\n return cn(\n 'shrink-0 rounded-full bg-current transition-all duration-200 motion-reduce:transition-none',\n dot.edge ? 'size-1 opacity-35' : 'size-1.5',\n dot.isActive ? 'opacity-100' : dot.edge ? '' : 'opacity-50',\n );\n}\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <div v-if=\"dots.length\" ref=\"el\" role=\"img\" :aria-label=\"label\" v-bind=\"rest\" :class=\"classes\">\n <span\n v-for=\"dot in dots\"\n :key=\"dot.position\"\n :class=\"dotClasses(dot)\"\n aria-hidden=\"true\"\n v-bind=\"{ 'data-dot': '', 'data-active': dot.isActive || undefined, 'data-edge': dot.edge }\"\n ></span>\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_Fragment","_renderList"],"mappings":";;;;;;;;;;;;;;AAmBA,UAAM,SAAS,UAAA;AAaf,UAAM,QAAQ;AACd,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA+B,IAAI;AAE9C,UAAM,OAAO,SAAS,MAAM,sBAAsB,MAAM,OAAO,MAAM,OAAO,MAAM,YAAY,CAAC;AAC/F,UAAM,UAAU,SAAS,MAAM,KAAK,MAAM,KAAK,CAAC,QAAQ,IAAI,QAAQ,GAAG,YAAY,CAAC;AACpF,UAAM,QAAQ;AAAA,MAAS,MACrB,OAAO;AAAA,QACL;AAAA,QACA,EAAE,OAAO,QAAQ,QAAQ,GAAG,OAAO,KAAK,IAAI,GAAG,MAAM,KAAK,EAAA;AAAA,QAC1D;AAAA,MAAA;AAAA,IACF;AAGF,UAAM,UAAU,SAAS,MAAM,GAAG,kCAAkC,MAAM,KAA2B,CAAC;AAGtG,aAAS,WAAW,KAA+B;AACjD,aAAO;AAAA,QACL;AAAA,QACA,IAAI,OAAO,sBAAsB;AAAA,QACjC,IAAI,WAAW,gBAAgB,IAAI,OAAO,KAAK;AAAA,MAAA;AAAA,IAEnD;AAGA,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIN,aAAA,KAAA,MAAK,UAAhBA,aAAAC,mBAQM,OARNC,WAQM;AAAA;iBARsB;AAAA,QAAJ,KAAI;AAAA,QAAK,MAAK;AAAA,QAAO,cAAY,MAAA;AAAA,MAAA,GAAe,KAAA,OAAI,EAAG,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,0BAC3FD,mBAMQE,UAAA,MAAAC,WALQ,KAAA,OAAI,CAAX,QAAG;AADZ,iBAAAJ,UAAA,GAAAC,mBAMQ,QANRC,WAMQ;AAAA,YAJL,KAAK,IAAI;AAAA,YACT,OAAO,WAAW,GAAG;AAAA,YACtB,eAAY;AAAA,UAAA,GAC6B,EAAA,SAAA,QAAA,EAAA,YAAA,IAAA,eAAA,IAAI,YAAY,QAAS,aAAe,IAAI,MAAI,GAAA,MAAA,EAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"DotsIndicator.vue.js","sources":["../../../../src/presentation/display/dotsIndicator/DotsIndicator.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DotsIndicatorProps {\n /** The total number of items the dots stand for. */\n readonly count: number;\n\n /** The current item, zero-based; clamped into range. */\n readonly index: number;\n\n /** The most dots shown; every item when there are fewer. Default 5. */\n readonly visibleCount?: number;\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, useAttrs, useTemplateRef } from 'vue';\nimport { useLocale } from '../../../foundation/i18n';\nimport { cn } from '../../../foundation/styles';\nimport { dotsIndicatorWindowOf, type DotsIndicatorDot } from './DotsIndicatorWindow';\n\nconst locale = useLocale();\n\n/**\n * Renders a row of dots for a position in a longer series, such as the image a card shows. It calculates its own\n * window: with more items than `visibleCount` it shows that many dots, keeps the current item's dot highlighted on\n * the centre while it can, slides along as `index` moves, and draws the edge dot smaller when more items lie beyond it.\n *\n * The dots are drawn in the current text colour, so a text colour utility such as `text-white` on a photograph\n * colours them; the current dot is solid and the rest are faded. Each dot is a slot of the row, not an item: when the\n * window slides and the current dot stays on the same slot, that dot does nothing at all, and only a slot whose state\n * changes animates. It is presentational: the row is one image named by its position, `3 of 10`.\n */\ndefineOptions({ name: 'DotsIndicator', inheritAttrs: false });\n\nconst props = withDefaults(defineProps<DotsIndicatorProps>(), { visibleCount: 5 });\nconst attrs = useAttrs();\nconst el = useTemplateRef<HTMLDivElement>('el');\n\nconst dots = computed(() => dotsIndicatorWindowOf(props.count, props.index, props.visibleCount));\nconst current = computed(() => dots.value.find((dot) => dot.isActive)?.position ?? 0);\nconst label = computed(() =>\n locale.t(\n 'DotsIndicator.position',\n { index: current.value + 1, total: Math.max(0, props.count) },\n '{index} of {total}',\n ),\n);\n\nconst classes = computed(() => cn('inline-flex items-center gap-1', attrs.class as string | undefined));\n\n/** One dot's size and fade: the current one solid, a window edge with more beyond it small and faint. */\nfunction dotClasses(dot: DotsIndicatorDot): string {\n return cn(\n 'shrink-0 rounded-full bg-current transition-all duration-200 motion-reduce:transition-none',\n dot.edge ? 'size-1 opacity-35' : 'size-1.5',\n dot.isActive ? 'opacity-100' : dot.edge ? '' : 'opacity-50',\n );\n}\n\n/** Everything but `class`, which is re-applied through `cn` above. */\nconst rest = computed(() => {\n const { class: _class, ...others } = attrs;\n return others;\n});\n\ndefineExpose({ el });\n</script>\n\n<template>\n <div v-if=\"dots.length\" ref=\"el\" role=\"img\" :aria-label=\"label\" v-bind=\"rest\" :class=\"classes\">\n <span\n v-for=\"(dot, slot) in dots\"\n :key=\"slot\"\n :class=\"dotClasses(dot)\"\n aria-hidden=\"true\"\n v-bind=\"{ 'data-dot': '', 'data-active': dot.isActive || undefined, 'data-edge': dot.edge }\"\n ></span>\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","_Fragment","_renderList"],"mappings":";;;;;;;;;;;;;;AAmBA,UAAM,SAAS,UAAA;AAcf,UAAM,QAAQ;AACd,UAAM,QAAQ,SAAA;AACd,UAAM,KAAK,eAA+B,IAAI;AAE9C,UAAM,OAAO,SAAS,MAAM,sBAAsB,MAAM,OAAO,MAAM,OAAO,MAAM,YAAY,CAAC;AAC/F,UAAM,UAAU,SAAS,MAAM,KAAK,MAAM,KAAK,CAAC,QAAQ,IAAI,QAAQ,GAAG,YAAY,CAAC;AACpF,UAAM,QAAQ;AAAA,MAAS,MACrB,OAAO;AAAA,QACL;AAAA,QACA,EAAE,OAAO,QAAQ,QAAQ,GAAG,OAAO,KAAK,IAAI,GAAG,MAAM,KAAK,EAAA;AAAA,QAC1D;AAAA,MAAA;AAAA,IACF;AAGF,UAAM,UAAU,SAAS,MAAM,GAAG,kCAAkC,MAAM,KAA2B,CAAC;AAGtG,aAAS,WAAW,KAA+B;AACjD,aAAO;AAAA,QACL;AAAA,QACA,IAAI,OAAO,sBAAsB;AAAA,QACjC,IAAI,WAAW,gBAAgB,IAAI,OAAO,KAAK;AAAA,MAAA;AAAA,IAEnD;AAGA,UAAM,OAAO,SAAS,MAAM;AAC1B,YAAM,EAAE,OAAO,QAAQ,GAAG,WAAW;AACrC,aAAO;AAAA,IACT,CAAC;AAED,aAAa,EAAE,IAAI;;AAIN,aAAA,KAAA,MAAK,UAAhBA,aAAAC,mBAQM,OARNC,WAQM;AAAA;iBARsB;AAAA,QAAJ,KAAI;AAAA,QAAK,MAAK;AAAA,QAAO,cAAY,MAAA;AAAA,MAAA,GAAe,KAAA,OAAI,EAAG,OAAO,QAAA,MAAA,CAAO,GAAA;AAAA,SAC3FF,UAAA,IAAA,GAAAC,mBAMQE,UAAA,MAAAC,WALgB,KAAA,OAAI,CAAlB,KAAK,SAAI;AADnB,iBAAAJ,UAAA,GAAAC,mBAMQ,QANRC,WAMQ;AAAA,YAJL,KAAK;AAAA,YACL,OAAO,WAAW,GAAG;AAAA,YACtB,eAAY;AAAA,UAAA,GAC6B,EAAA,SAAA,QAAA,EAAA,YAAA,IAAA,eAAA,IAAI,YAAY,QAAS,aAAe,IAAI,MAAI,GAAA,MAAA,EAAA;AAAA;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wow-two-beta/fe",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "Beta-forever Vue 3 fe sdk for the wow-two ecosystem — components, application adapters and browser capabilities.",
5
5
  "license": "MIT",
6
6
  "repository": {