@templatical/editor 0.12.0 → 0.12.1
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/dist/{CloudEditor-F5YV5hE3.js → CloudEditor-CB16QzKM.js} +1 -1
- package/dist/{CountdownToolbar-CDy9_2Yj.js → CountdownToolbar-Dol7Q0Pv.js} +1 -1
- package/dist/{NumberWithSuffix-Cd7bz1Wk.js → NumberWithSuffix-Bp40ik4l.js} +101 -79
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{CloudEditor-OO8hWAVp.js → CloudEditor-DSeihOan.js} +2 -2
- package/dist/cdn/chunks/{CloudEditor-OO8hWAVp.js.map → CloudEditor-DSeihOan.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BXjDFRHI.js → CountdownToolbar-BQn0Kj0X.js} +2 -2
- package/dist/cdn/chunks/{CountdownToolbar-BXjDFRHI.js.map → CountdownToolbar-BQn0Kj0X.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-ZuJ2ePB0.js → NumberWithSuffix-cdWjAK6y.js} +139 -118
- package/dist/cdn/chunks/NumberWithSuffix-cdWjAK6y.js.map +1 -0
- package/dist/cdn/chunks/{de-DpBN9H7-.js → de-BpseTWOA.js} +4 -2
- package/dist/cdn/chunks/{de-DpBN9H7-.js.map → de-BpseTWOA.js.map} +1 -1
- package/dist/cdn/chunks/{en-BhHtdIiU.js → en-VGIQ0WNq.js} +4 -2
- package/dist/cdn/chunks/{en-BhHtdIiU.js.map → en-VGIQ0WNq.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-Bth5a93y.js → pt-BR-zAqpLQbW.js} +4 -2
- package/dist/cdn/chunks/{pt-BR-Bth5a93y.js.map → pt-BR-zAqpLQbW.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-DwPomkBw.js → renderer-C0vdAODQ.js} +2 -2
- package/dist/cdn/chunks/{renderer-DwPomkBw.js.map → renderer-C0vdAODQ.js.map} +1 -1
- package/dist/cdn/chunks/{styles-D45rgVq8.js → styles-LfeoSNRA.js} +434 -430
- package/dist/cdn/chunks/{styles-D45rgVq8.js.map → styles-LfeoSNRA.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +7 -7
- package/dist/{de-DpBN9H7-.js → de-BpseTWOA.js} +3 -1
- package/dist/{en-BhHtdIiU.js → en-VGIQ0WNq.js} +3 -1
- package/dist/{pt-BR-Bth5a93y.js → pt-BR-zAqpLQbW.js} +3 -1
- package/dist/style.css +1 -1
- package/dist/{styles-Dp4mJuCM.js → styles-DSm9Ijxt.js} +469 -465
- package/dist/templatical-editor.js +6 -6
- package/package.json +7 -7
- package/dist/cdn/chunks/NumberWithSuffix-ZuJ2ePB0.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as e, P as t, V as n, ct as r, f as i, g as a, it as o, m as s, ot as c, p as l, u, v as d, x as f, y as p } from "./draggable-Bci-fq8y.js";
|
|
2
2
|
import { Ft as m } from "./features-DxWz_Enw.js";
|
|
3
3
|
import { f as h } from "./styleConstants-lGobwiLH.js";
|
|
4
|
-
import { i as g, n as _, r as v, t as y } from "./NumberWithSuffix-
|
|
4
|
+
import { i as g, n as _, r as v, t as y } from "./NumberWithSuffix-cdWjAK6y.js";
|
|
5
5
|
//#region src/components/toolbar/CheckboxItem.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var b = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, x = ["checked"], S = /* @__PURE__ */ f({
|
|
7
7
|
__name: "CheckboxItem",
|
|
@@ -209,4 +209,4 @@ var b = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:tex
|
|
|
209
209
|
//#endregion
|
|
210
210
|
export { I as default };
|
|
211
211
|
|
|
212
|
-
//# sourceMappingURL=CountdownToolbar-
|
|
212
|
+
//# sourceMappingURL=CountdownToolbar-BQn0Kj0X.js.map
|
package/dist/cdn/chunks/{CountdownToolbar-BXjDFRHI.js.map → CountdownToolbar-BQn0Kj0X.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountdownToolbar-BXjDFRHI.js","names":[],"sources":["../../../src/components/toolbar/CheckboxItem.vue","../../../src/components/toolbar/CheckboxItem.vue","../../../src/components/toolbar/CountdownToolbar.vue","../../../src/components/toolbar/CountdownToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean;\n label: string;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n</script>\n\n<template>\n <label\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]\"\n >\n <input\n type=\"checkbox\"\n class=\"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]\"\n :checked=\"modelValue\"\n @change=\"\n emit('update:modelValue', ($event.target as HTMLInputElement).checked)\n \"\n />\n {{ label }}\n </label>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean;\n label: string;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n</script>\n\n<template>\n <label\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]\"\n >\n <input\n type=\"checkbox\"\n class=\"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]\"\n :checked=\"modelValue\"\n @change=\"\n emit('update:modelValue', ($event.target as HTMLInputElement).checked)\n \"\n />\n {{ label }}\n </label>\n</template>\n","<script setup lang=\"ts\">\nimport ColorPicker from \"../ColorPicker.vue\";\nimport SlidingPillSelect from \"../SlidingPillSelect.vue\";\nimport FieldRow from \"./FieldRow.vue\";\nimport CheckboxItem from \"./CheckboxItem.vue\";\nimport NumberWithSuffix from \"./NumberWithSuffix.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { inputClass } from \"../../constants/styleConstants\";\nimport type { CountdownBlock } from \"@templatical/types\";\nimport { computed } from \"vue\";\n\ndefineProps<{\n block: CountdownBlock;\n fontFamilies: Array<{ value: string; label: string }>;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update\", updates: Partial<CountdownBlock>): void;\n}>();\n\nconst { t } = useI18n();\n\nconst TIMEZONES = [\n \"UTC\",\n \"America/New_York\",\n \"America/Chicago\",\n \"America/Denver\",\n \"America/Los_Angeles\",\n \"Europe/London\",\n \"Europe/Berlin\",\n \"Europe/Paris\",\n \"Europe/Moscow\",\n \"Asia/Dubai\",\n \"Asia/Kolkata\",\n \"Asia/Shanghai\",\n \"Asia/Tokyo\",\n \"Australia/Sydney\",\n \"Pacific/Auckland\",\n];\n\nconst SEPARATORS = [\n { value: \":\", label: \":\" },\n { value: \"-\", label: \"-\" },\n { value: \" \", label: \"␣\" },\n];\n\ntype UnitKey = \"Days\" | \"Hours\" | \"Minutes\" | \"Seconds\";\nconst UNITS: UnitKey[] = [\"Days\", \"Hours\", \"Minutes\", \"Seconds\"];\n\nconst unitItems = computed(() =>\n UNITS.map((unit) => ({\n unit,\n showKey: `show${unit}` as const,\n labelKey: `label${unit}` as const,\n translationKey: unit.toLowerCase() as\n | \"days\"\n | \"hours\"\n | \"minutes\"\n | \"seconds\",\n })),\n);\n\nfunction updateField(field: keyof CountdownBlock, value: unknown): void {\n emit(\"update\", { [field]: value } as Partial<CountdownBlock>);\n}\n</script>\n\n<template>\n <FieldRow :label=\"t.countdown.targetDate\">\n <input\n type=\"datetime-local\"\n :class=\"inputClass\"\n :value=\"block.targetDate\"\n @input=\"\n updateField('targetDate', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.timezone\">\n <select\n :class=\"inputClass\"\n :value=\"block.timezone\"\n @change=\"\n updateField('timezone', ($event.target as HTMLSelectElement).value)\n \"\n >\n <option v-for=\"tz in TIMEZONES\" :key=\"tz\" :value=\"tz\">{{ tz }}</option>\n </select>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.display\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <CheckboxItem\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n :model-value=\"block[item.showKey]\"\n :label=\"t.countdown[item.translationKey]\"\n @update:model-value=\"updateField(item.showKey, $event)\"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.separator\">\n <SlidingPillSelect\n :options=\"SEPARATORS\"\n :model-value=\"block.separator\"\n @update:model-value=\"updateField('separator', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.fontFamily\">\n <select\n :class=\"inputClass\"\n :value=\"block.fontFamily || ''\"\n @change=\"\n updateField(\n 'fontFamily',\n ($event.target as HTMLSelectElement).value || undefined,\n )\n \"\n >\n <option value=\"\">{{ t.countdown.inheritFont }}</option>\n <option\n v-for=\"font in fontFamilies\"\n :key=\"font.value\"\n :value=\"font.value\"\n >\n {{ font.label }}\n </option>\n </select>\n </FieldRow>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitFontSize\">\n <NumberWithSuffix\n :model-value=\"block.digitFontSize\"\n :min=\"12\"\n :max=\"72\"\n suffix=\"px\"\n @update:model-value=\"updateField('digitFontSize', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelFontSize\">\n <NumberWithSuffix\n :model-value=\"block.labelFontSize\"\n :min=\"8\"\n :max=\"24\"\n suffix=\"px\"\n @update:model-value=\"updateField('labelFontSize', $event)\"\n />\n </FieldRow>\n </div>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitColor\">\n <ColorPicker\n :model-value=\"block.digitColor\"\n @update:model-value=\"updateField('digitColor', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelColor\">\n <ColorPicker\n :model-value=\"block.labelColor\"\n @update:model-value=\"updateField('labelColor', $event)\"\n />\n </FieldRow>\n </div>\n\n <FieldRow :label=\"t.countdown.background\">\n <ColorPicker\n :model-value=\"block.backgroundColor\"\n @update:model-value=\"updateField('backgroundColor', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.labels\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <input\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block[item.labelKey]\"\n :placeholder=\"t.countdown[item.translationKey]\"\n @input=\"\n updateField(item.labelKey, ($event.target as HTMLInputElement).value)\n \"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiry\">\n <input\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block.expiredMessage\"\n :placeholder=\"t.countdown.expiredMessagePlaceholder\"\n @input=\"\n updateField('expiredMessage', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiredImageUrl\">\n <input\n type=\"url\"\n :class=\"inputClass\"\n :value=\"block.expiredImageUrl\"\n placeholder=\"https://...\"\n @input=\"\n updateField(\n 'expiredImageUrl',\n ($event.target as HTMLInputElement).value,\n )\n \"\n />\n </FieldRow>\n\n <CheckboxItem\n :model-value=\"block.hideOnExpiry\"\n :label=\"t.countdown.hideOnExpiry\"\n class=\"tpl:mb-3.5\"\n @update:model-value=\"updateField('hideOnExpiry', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport ColorPicker from \"../ColorPicker.vue\";\nimport SlidingPillSelect from \"../SlidingPillSelect.vue\";\nimport FieldRow from \"./FieldRow.vue\";\nimport CheckboxItem from \"./CheckboxItem.vue\";\nimport NumberWithSuffix from \"./NumberWithSuffix.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { inputClass } from \"../../constants/styleConstants\";\nimport type { CountdownBlock } from \"@templatical/types\";\nimport { computed } from \"vue\";\n\ndefineProps<{\n block: CountdownBlock;\n fontFamilies: Array<{ value: string; label: string }>;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update\", updates: Partial<CountdownBlock>): void;\n}>();\n\nconst { t } = useI18n();\n\nconst TIMEZONES = [\n \"UTC\",\n \"America/New_York\",\n \"America/Chicago\",\n \"America/Denver\",\n \"America/Los_Angeles\",\n \"Europe/London\",\n \"Europe/Berlin\",\n \"Europe/Paris\",\n \"Europe/Moscow\",\n \"Asia/Dubai\",\n \"Asia/Kolkata\",\n \"Asia/Shanghai\",\n \"Asia/Tokyo\",\n \"Australia/Sydney\",\n \"Pacific/Auckland\",\n];\n\nconst SEPARATORS = [\n { value: \":\", label: \":\" },\n { value: \"-\", label: \"-\" },\n { value: \" \", label: \"␣\" },\n];\n\ntype UnitKey = \"Days\" | \"Hours\" | \"Minutes\" | \"Seconds\";\nconst UNITS: UnitKey[] = [\"Days\", \"Hours\", \"Minutes\", \"Seconds\"];\n\nconst unitItems = computed(() =>\n UNITS.map((unit) => ({\n unit,\n showKey: `show${unit}` as const,\n labelKey: `label${unit}` as const,\n translationKey: unit.toLowerCase() as\n | \"days\"\n | \"hours\"\n | \"minutes\"\n | \"seconds\",\n })),\n);\n\nfunction updateField(field: keyof CountdownBlock, value: unknown): void {\n emit(\"update\", { [field]: value } as Partial<CountdownBlock>);\n}\n</script>\n\n<template>\n <FieldRow :label=\"t.countdown.targetDate\">\n <input\n type=\"datetime-local\"\n :class=\"inputClass\"\n :value=\"block.targetDate\"\n @input=\"\n updateField('targetDate', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.timezone\">\n <select\n :class=\"inputClass\"\n :value=\"block.timezone\"\n @change=\"\n updateField('timezone', ($event.target as HTMLSelectElement).value)\n \"\n >\n <option v-for=\"tz in TIMEZONES\" :key=\"tz\" :value=\"tz\">{{ tz }}</option>\n </select>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.display\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <CheckboxItem\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n :model-value=\"block[item.showKey]\"\n :label=\"t.countdown[item.translationKey]\"\n @update:model-value=\"updateField(item.showKey, $event)\"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.separator\">\n <SlidingPillSelect\n :options=\"SEPARATORS\"\n :model-value=\"block.separator\"\n @update:model-value=\"updateField('separator', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.fontFamily\">\n <select\n :class=\"inputClass\"\n :value=\"block.fontFamily || ''\"\n @change=\"\n updateField(\n 'fontFamily',\n ($event.target as HTMLSelectElement).value || undefined,\n )\n \"\n >\n <option value=\"\">{{ t.countdown.inheritFont }}</option>\n <option\n v-for=\"font in fontFamilies\"\n :key=\"font.value\"\n :value=\"font.value\"\n >\n {{ font.label }}\n </option>\n </select>\n </FieldRow>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitFontSize\">\n <NumberWithSuffix\n :model-value=\"block.digitFontSize\"\n :min=\"12\"\n :max=\"72\"\n suffix=\"px\"\n @update:model-value=\"updateField('digitFontSize', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelFontSize\">\n <NumberWithSuffix\n :model-value=\"block.labelFontSize\"\n :min=\"8\"\n :max=\"24\"\n suffix=\"px\"\n @update:model-value=\"updateField('labelFontSize', $event)\"\n />\n </FieldRow>\n </div>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitColor\">\n <ColorPicker\n :model-value=\"block.digitColor\"\n @update:model-value=\"updateField('digitColor', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelColor\">\n <ColorPicker\n :model-value=\"block.labelColor\"\n @update:model-value=\"updateField('labelColor', $event)\"\n />\n </FieldRow>\n </div>\n\n <FieldRow :label=\"t.countdown.background\">\n <ColorPicker\n :model-value=\"block.backgroundColor\"\n @update:model-value=\"updateField('backgroundColor', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.labels\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <input\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block[item.labelKey]\"\n :placeholder=\"t.countdown[item.translationKey]\"\n @input=\"\n updateField(item.labelKey, ($event.target as HTMLInputElement).value)\n \"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiry\">\n <input\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block.expiredMessage\"\n :placeholder=\"t.countdown.expiredMessagePlaceholder\"\n @input=\"\n updateField('expiredMessage', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiredImageUrl\">\n <input\n type=\"url\"\n :class=\"inputClass\"\n :value=\"block.expiredImageUrl\"\n placeholder=\"https://...\"\n @input=\"\n updateField(\n 'expiredImageUrl',\n ($event.target as HTMLInputElement).value,\n )\n \"\n />\n </FieldRow>\n\n <CheckboxItem\n :model-value=\"block.hideOnExpiry\"\n :label=\"t.countdown.hideOnExpiry\"\n class=\"tpl:mb-3.5\"\n @update:model-value=\"updateField('hideOnExpiry', $event)\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMA,IAAM,IAAO;yBAMX,EAYQ,SAZR,GAYQ,CATN,EAOE,SAAA;GANA,MAAK;GACL,OAAM;GACL,SAAS,EAAA;GACT,UAAM,AAAA,EAAA,QAAA,MAAW,EAAI,qBAAuB,EAAO,OAA4B,OAAO;qBAGvF,MACF,EAAG,EAAA,KAAK,GAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;EEPZ,IAAM,IAAO,GAIP,EAAE,SAAM,EAAQ,GAEhB,IAAY;GAChB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;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A4B,KAAK;;;;GAM5F,EAaW,GAAA,EAbA,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU,gBAAA,GAAA;qBAY1B,CAXF,EAWE,SAAA;KAVA,MAAK;KACJ,OAAK,EAAE,EAAA,CAAA,CAAU;KACjB,OAAO,EAAA,MAAM;KACd,aAAY;KACX,SAAK,AAAA,EAAA,SAAA,MAAW,EAAA,mBAAqD,EAAO,OAA4B,KAAA;;;;GAS7G,EAKE,GAAA;IAJC,eAAa,EAAA,MAAM;IACnB,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU;IACpB,OAAM;IACL,uBAAkB,AAAA,EAAA,SAAA,MAAE,EAAW,gBAAiB,CAAM"}
|
|
1
|
+
{"version":3,"file":"CountdownToolbar-BQn0Kj0X.js","names":[],"sources":["../../../src/components/toolbar/CheckboxItem.vue","../../../src/components/toolbar/CheckboxItem.vue","../../../src/components/toolbar/CountdownToolbar.vue","../../../src/components/toolbar/CountdownToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean;\n label: string;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n</script>\n\n<template>\n <label\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]\"\n >\n <input\n type=\"checkbox\"\n class=\"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]\"\n :checked=\"modelValue\"\n @change=\"\n emit('update:modelValue', ($event.target as HTMLInputElement).checked)\n \"\n />\n {{ label }}\n </label>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{\n modelValue: boolean;\n label: string;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update:modelValue\", value: boolean): void;\n}>();\n</script>\n\n<template>\n <label\n class=\"tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]\"\n >\n <input\n type=\"checkbox\"\n class=\"tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]\"\n :checked=\"modelValue\"\n @change=\"\n emit('update:modelValue', ($event.target as HTMLInputElement).checked)\n \"\n />\n {{ label }}\n </label>\n</template>\n","<script setup lang=\"ts\">\nimport ColorPicker from \"../ColorPicker.vue\";\nimport SlidingPillSelect from \"../SlidingPillSelect.vue\";\nimport FieldRow from \"./FieldRow.vue\";\nimport CheckboxItem from \"./CheckboxItem.vue\";\nimport NumberWithSuffix from \"./NumberWithSuffix.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { inputClass } from \"../../constants/styleConstants\";\nimport type { CountdownBlock } from \"@templatical/types\";\nimport { computed } from \"vue\";\n\ndefineProps<{\n block: CountdownBlock;\n fontFamilies: Array<{ value: string; label: string }>;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update\", updates: Partial<CountdownBlock>): void;\n}>();\n\nconst { t } = useI18n();\n\nconst TIMEZONES = [\n \"UTC\",\n \"America/New_York\",\n \"America/Chicago\",\n \"America/Denver\",\n \"America/Los_Angeles\",\n \"Europe/London\",\n \"Europe/Berlin\",\n \"Europe/Paris\",\n \"Europe/Moscow\",\n \"Asia/Dubai\",\n \"Asia/Kolkata\",\n \"Asia/Shanghai\",\n \"Asia/Tokyo\",\n \"Australia/Sydney\",\n \"Pacific/Auckland\",\n];\n\nconst SEPARATORS = [\n { value: \":\", label: \":\" },\n { value: \"-\", label: \"-\" },\n { value: \" \", label: \"␣\" },\n];\n\ntype UnitKey = \"Days\" | \"Hours\" | \"Minutes\" | \"Seconds\";\nconst UNITS: UnitKey[] = [\"Days\", \"Hours\", \"Minutes\", \"Seconds\"];\n\nconst unitItems = computed(() =>\n UNITS.map((unit) => ({\n unit,\n showKey: `show${unit}` as const,\n labelKey: `label${unit}` as const,\n translationKey: unit.toLowerCase() as\n | \"days\"\n | \"hours\"\n | \"minutes\"\n | \"seconds\",\n })),\n);\n\nfunction updateField(field: keyof CountdownBlock, value: unknown): void {\n emit(\"update\", { [field]: value } as Partial<CountdownBlock>);\n}\n</script>\n\n<template>\n <FieldRow :label=\"t.countdown.targetDate\">\n <input\n type=\"datetime-local\"\n :class=\"inputClass\"\n :value=\"block.targetDate\"\n @input=\"\n updateField('targetDate', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.timezone\">\n <select\n :class=\"inputClass\"\n :value=\"block.timezone\"\n @change=\"\n updateField('timezone', ($event.target as HTMLSelectElement).value)\n \"\n >\n <option v-for=\"tz in TIMEZONES\" :key=\"tz\" :value=\"tz\">{{ tz }}</option>\n </select>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.display\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <CheckboxItem\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n :model-value=\"block[item.showKey]\"\n :label=\"t.countdown[item.translationKey]\"\n @update:model-value=\"updateField(item.showKey, $event)\"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.separator\">\n <SlidingPillSelect\n :options=\"SEPARATORS\"\n :model-value=\"block.separator\"\n @update:model-value=\"updateField('separator', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.fontFamily\">\n <select\n :class=\"inputClass\"\n :value=\"block.fontFamily || ''\"\n @change=\"\n updateField(\n 'fontFamily',\n ($event.target as HTMLSelectElement).value || undefined,\n )\n \"\n >\n <option value=\"\">{{ t.countdown.inheritFont }}</option>\n <option\n v-for=\"font in fontFamilies\"\n :key=\"font.value\"\n :value=\"font.value\"\n >\n {{ font.label }}\n </option>\n </select>\n </FieldRow>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitFontSize\">\n <NumberWithSuffix\n :model-value=\"block.digitFontSize\"\n :min=\"12\"\n :max=\"72\"\n suffix=\"px\"\n @update:model-value=\"updateField('digitFontSize', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelFontSize\">\n <NumberWithSuffix\n :model-value=\"block.labelFontSize\"\n :min=\"8\"\n :max=\"24\"\n suffix=\"px\"\n @update:model-value=\"updateField('labelFontSize', $event)\"\n />\n </FieldRow>\n </div>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitColor\">\n <ColorPicker\n :model-value=\"block.digitColor\"\n @update:model-value=\"updateField('digitColor', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelColor\">\n <ColorPicker\n :model-value=\"block.labelColor\"\n @update:model-value=\"updateField('labelColor', $event)\"\n />\n </FieldRow>\n </div>\n\n <FieldRow :label=\"t.countdown.background\">\n <ColorPicker\n :model-value=\"block.backgroundColor\"\n @update:model-value=\"updateField('backgroundColor', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.labels\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <input\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block[item.labelKey]\"\n :placeholder=\"t.countdown[item.translationKey]\"\n @input=\"\n updateField(item.labelKey, ($event.target as HTMLInputElement).value)\n \"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiry\">\n <input\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block.expiredMessage\"\n :placeholder=\"t.countdown.expiredMessagePlaceholder\"\n @input=\"\n updateField('expiredMessage', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiredImageUrl\">\n <input\n type=\"url\"\n :class=\"inputClass\"\n :value=\"block.expiredImageUrl\"\n placeholder=\"https://...\"\n @input=\"\n updateField(\n 'expiredImageUrl',\n ($event.target as HTMLInputElement).value,\n )\n \"\n />\n </FieldRow>\n\n <CheckboxItem\n :model-value=\"block.hideOnExpiry\"\n :label=\"t.countdown.hideOnExpiry\"\n class=\"tpl:mb-3.5\"\n @update:model-value=\"updateField('hideOnExpiry', $event)\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport ColorPicker from \"../ColorPicker.vue\";\nimport SlidingPillSelect from \"../SlidingPillSelect.vue\";\nimport FieldRow from \"./FieldRow.vue\";\nimport CheckboxItem from \"./CheckboxItem.vue\";\nimport NumberWithSuffix from \"./NumberWithSuffix.vue\";\nimport { useI18n } from \"../../composables/useI18n\";\nimport { inputClass } from \"../../constants/styleConstants\";\nimport type { CountdownBlock } from \"@templatical/types\";\nimport { computed } from \"vue\";\n\ndefineProps<{\n block: CountdownBlock;\n fontFamilies: Array<{ value: string; label: string }>;\n}>();\n\nconst emit = defineEmits<{\n (e: \"update\", updates: Partial<CountdownBlock>): void;\n}>();\n\nconst { t } = useI18n();\n\nconst TIMEZONES = [\n \"UTC\",\n \"America/New_York\",\n \"America/Chicago\",\n \"America/Denver\",\n \"America/Los_Angeles\",\n \"Europe/London\",\n \"Europe/Berlin\",\n \"Europe/Paris\",\n \"Europe/Moscow\",\n \"Asia/Dubai\",\n \"Asia/Kolkata\",\n \"Asia/Shanghai\",\n \"Asia/Tokyo\",\n \"Australia/Sydney\",\n \"Pacific/Auckland\",\n];\n\nconst SEPARATORS = [\n { value: \":\", label: \":\" },\n { value: \"-\", label: \"-\" },\n { value: \" \", label: \"␣\" },\n];\n\ntype UnitKey = \"Days\" | \"Hours\" | \"Minutes\" | \"Seconds\";\nconst UNITS: UnitKey[] = [\"Days\", \"Hours\", \"Minutes\", \"Seconds\"];\n\nconst unitItems = computed(() =>\n UNITS.map((unit) => ({\n unit,\n showKey: `show${unit}` as const,\n labelKey: `label${unit}` as const,\n translationKey: unit.toLowerCase() as\n | \"days\"\n | \"hours\"\n | \"minutes\"\n | \"seconds\",\n })),\n);\n\nfunction updateField(field: keyof CountdownBlock, value: unknown): void {\n emit(\"update\", { [field]: value } as Partial<CountdownBlock>);\n}\n</script>\n\n<template>\n <FieldRow :label=\"t.countdown.targetDate\">\n <input\n type=\"datetime-local\"\n :class=\"inputClass\"\n :value=\"block.targetDate\"\n @input=\"\n updateField('targetDate', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.timezone\">\n <select\n :class=\"inputClass\"\n :value=\"block.timezone\"\n @change=\"\n updateField('timezone', ($event.target as HTMLSelectElement).value)\n \"\n >\n <option v-for=\"tz in TIMEZONES\" :key=\"tz\" :value=\"tz\">{{ tz }}</option>\n </select>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.display\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <CheckboxItem\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n :model-value=\"block[item.showKey]\"\n :label=\"t.countdown[item.translationKey]\"\n @update:model-value=\"updateField(item.showKey, $event)\"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.separator\">\n <SlidingPillSelect\n :options=\"SEPARATORS\"\n :model-value=\"block.separator\"\n @update:model-value=\"updateField('separator', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.fontFamily\">\n <select\n :class=\"inputClass\"\n :value=\"block.fontFamily || ''\"\n @change=\"\n updateField(\n 'fontFamily',\n ($event.target as HTMLSelectElement).value || undefined,\n )\n \"\n >\n <option value=\"\">{{ t.countdown.inheritFont }}</option>\n <option\n v-for=\"font in fontFamilies\"\n :key=\"font.value\"\n :value=\"font.value\"\n >\n {{ font.label }}\n </option>\n </select>\n </FieldRow>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitFontSize\">\n <NumberWithSuffix\n :model-value=\"block.digitFontSize\"\n :min=\"12\"\n :max=\"72\"\n suffix=\"px\"\n @update:model-value=\"updateField('digitFontSize', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelFontSize\">\n <NumberWithSuffix\n :model-value=\"block.labelFontSize\"\n :min=\"8\"\n :max=\"24\"\n suffix=\"px\"\n @update:model-value=\"updateField('labelFontSize', $event)\"\n />\n </FieldRow>\n </div>\n\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-3\">\n <FieldRow :label=\"t.countdown.digitColor\">\n <ColorPicker\n :model-value=\"block.digitColor\"\n @update:model-value=\"updateField('digitColor', $event)\"\n />\n </FieldRow>\n <FieldRow :label=\"t.countdown.labelColor\">\n <ColorPicker\n :model-value=\"block.labelColor\"\n @update:model-value=\"updateField('labelColor', $event)\"\n />\n </FieldRow>\n </div>\n\n <FieldRow :label=\"t.countdown.background\">\n <ColorPicker\n :model-value=\"block.backgroundColor\"\n @update:model-value=\"updateField('backgroundColor', $event)\"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.labels\">\n <div class=\"tpl:grid tpl:grid-cols-2 tpl:gap-2\">\n <input\n v-for=\"item in unitItems\"\n :key=\"item.unit\"\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block[item.labelKey]\"\n :placeholder=\"t.countdown[item.translationKey]\"\n @input=\"\n updateField(item.labelKey, ($event.target as HTMLInputElement).value)\n \"\n />\n </div>\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiry\">\n <input\n type=\"text\"\n :class=\"inputClass\"\n :value=\"block.expiredMessage\"\n :placeholder=\"t.countdown.expiredMessagePlaceholder\"\n @input=\"\n updateField('expiredMessage', ($event.target as HTMLInputElement).value)\n \"\n />\n </FieldRow>\n\n <FieldRow :label=\"t.countdown.expiredImageUrl\">\n <input\n type=\"url\"\n :class=\"inputClass\"\n :value=\"block.expiredImageUrl\"\n placeholder=\"https://...\"\n @input=\"\n updateField(\n 'expiredImageUrl',\n ($event.target as HTMLInputElement).value,\n )\n \"\n />\n </FieldRow>\n\n <CheckboxItem\n :model-value=\"block.hideOnExpiry\"\n :label=\"t.countdown.hideOnExpiry\"\n class=\"tpl:mb-3.5\"\n @update:model-value=\"updateField('hideOnExpiry', $event)\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;EAMA,IAAM,IAAO;yBAMX,EAYQ,SA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AK,UAAW,EAAO,OAA4B,KAAK;;;;GAO7F,EAUW,GAAA,EAVA,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU,OAAA,GAAA;qBAS1B,CARF,EAQE,SAAA;KAPA,MAAK;KACJ,OAAK,EAAE,EAAA,CAAA,CAAU;KACjB,OAAO,EAAA,MAAM;KACb,aAAa,EAAA,CAAA,CAAC,CAAC,UAAU;KACzB,SAAK,AAAA,EAAA,QAAA,MAAW,EAAW,kBAAoB,EAAO,OAA4B,KAAK;;;;GAM5F,EAaW,GAAA,EAbA,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU,gBAAA,GAAA;qBAY1B,CAXF,EAWE,SAAA;KAVA,MAAK;KACJ,OAAK,EAAE,EAAA,CAAA,CAAU;KACjB,OAAO,EAAA,MAAM;KACd,aAAY;KACX,SAAK,AAAA,EAAA,SAAA,MAAW,EAAA,mBAAqD,EAAO,OAA4B,KAAA;;;;GAS7G,EAKE,GAAA;IAJC,eAAa,EAAA,MAAM;IACnB,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU;IACpB,OAAM;IACL,uBAAkB,AAAA,EAAA,SAAA,MAAE,EAAW,gBAAiB,CAAM"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { F as e, L as t, M as n, P as r, V as i, Z as a, c as o, ct as s, f as c, g as l, h as u, it as d, m as f, n as p, ot as m, p as h, st as g, u as _, x as v, y } from "./draggable-Bci-fq8y.js";
|
|
2
|
-
import { Ft as ee,
|
|
3
|
-
import { h as b,
|
|
2
|
+
import { Ft as ee, at as te, on as ne } from "./features-DxWz_Enw.js";
|
|
3
|
+
import { h as b, m as x, p as S, u as re } from "./styleConstants-lGobwiLH.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
|
|
5
|
-
var
|
|
5
|
+
var C = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, w = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
6
6
|
360 / (Math.PI * 2);
|
|
7
|
-
var
|
|
7
|
+
var T = (e) => ae(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
8
8
|
r: parseInt(e[0] + e[0], 16),
|
|
9
9
|
g: parseInt(e[1] + e[1], 16),
|
|
10
10
|
b: parseInt(e[2] + e[2], 16),
|
|
11
|
-
a: e.length === 4 ?
|
|
11
|
+
a: e.length === 4 ? w(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
12
12
|
} : {
|
|
13
13
|
r: parseInt(e.substring(0, 2), 16),
|
|
14
14
|
g: parseInt(e.substring(2, 4), 16),
|
|
15
15
|
b: parseInt(e.substring(4, 6), 16),
|
|
16
|
-
a: e.length === 8 ?
|
|
17
|
-
}),
|
|
16
|
+
a: e.length === 8 ? w(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
17
|
+
}), D = (e) => ie(A(e)), O = ({ h: e, s: t, v: n, a: r }) => {
|
|
18
18
|
let i = (200 - t) * n / 100;
|
|
19
19
|
return {
|
|
20
|
-
h:
|
|
21
|
-
s:
|
|
22
|
-
l:
|
|
23
|
-
a:
|
|
20
|
+
h: w(e),
|
|
21
|
+
s: w(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
22
|
+
l: w(i / 2),
|
|
23
|
+
a: w(r, 2)
|
|
24
24
|
};
|
|
25
|
-
},
|
|
26
|
-
let { h: t, s: n, l: r } =
|
|
25
|
+
}, k = (e) => {
|
|
26
|
+
let { h: t, s: n, l: r } = O(e);
|
|
27
27
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
28
|
-
},
|
|
28
|
+
}, A = ({ h: e, s: t, v: n, a: r }) => {
|
|
29
29
|
e = e / 360 * 6, t /= 100, n /= 100;
|
|
30
30
|
let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
|
|
31
31
|
return {
|
|
32
|
-
r:
|
|
32
|
+
r: w([
|
|
33
33
|
n,
|
|
34
34
|
o,
|
|
35
35
|
a,
|
|
@@ -37,7 +37,7 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
37
37
|
s,
|
|
38
38
|
n
|
|
39
39
|
][c] * 255),
|
|
40
|
-
g:
|
|
40
|
+
g: w([
|
|
41
41
|
s,
|
|
42
42
|
n,
|
|
43
43
|
n,
|
|
@@ -45,7 +45,7 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
45
45
|
a,
|
|
46
46
|
a
|
|
47
47
|
][c] * 255),
|
|
48
|
-
b:
|
|
48
|
+
b: w([
|
|
49
49
|
a,
|
|
50
50
|
a,
|
|
51
51
|
s,
|
|
@@ -53,62 +53,62 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
53
53
|
n,
|
|
54
54
|
o
|
|
55
55
|
][c] * 255),
|
|
56
|
-
a:
|
|
56
|
+
a: w(r, 2)
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, j = (e) => {
|
|
59
59
|
let t = e.toString(16);
|
|
60
60
|
return t.length < 2 ? "0" + t : t;
|
|
61
|
+
}, ie = ({ r: e, g: t, b: n, a: r }) => {
|
|
62
|
+
let i = r < 1 ? j(w(r * 255)) : "";
|
|
63
|
+
return "#" + j(e) + j(t) + j(n) + i;
|
|
61
64
|
}, ae = ({ r: e, g: t, b: n, a: r }) => {
|
|
62
|
-
let i = r < 1 ? A(T(r * 255)) : "";
|
|
63
|
-
return "#" + A(e) + A(t) + A(n) + i;
|
|
64
|
-
}, oe = ({ r: e, g: t, b: n, a: r }) => {
|
|
65
65
|
let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
|
|
66
66
|
return {
|
|
67
|
-
h:
|
|
68
|
-
s:
|
|
69
|
-
v:
|
|
67
|
+
h: w(60 * (o < 0 ? o + 6 : o)),
|
|
68
|
+
s: w(i ? a / i * 100 : 0),
|
|
69
|
+
v: w(i / 255 * 100),
|
|
70
70
|
a: r
|
|
71
71
|
};
|
|
72
|
-
},
|
|
72
|
+
}, M = (e, t) => {
|
|
73
73
|
if (e === t) return !0;
|
|
74
74
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
75
75
|
return !0;
|
|
76
|
-
},
|
|
77
|
-
let t =
|
|
78
|
-
return t || (t = document.createElement("template"), t.innerHTML = e,
|
|
79
|
-
},
|
|
76
|
+
}, N = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : M(E(e), E(t)), P = {}, F = (e) => {
|
|
77
|
+
let t = P[e];
|
|
78
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, P[e] = t), t;
|
|
79
|
+
}, I = (e, t, n) => {
|
|
80
80
|
e.dispatchEvent(new CustomEvent(t, {
|
|
81
81
|
bubbles: !0,
|
|
82
82
|
detail: n
|
|
83
83
|
}));
|
|
84
|
-
},
|
|
85
|
-
let n =
|
|
86
|
-
|
|
87
|
-
x:
|
|
88
|
-
y:
|
|
84
|
+
}, L = !1, R = (e) => "touches" in e, oe = (e) => L && !R(e) ? !1 : (L ||= R(e), !0), z = (e, t) => {
|
|
85
|
+
let n = R(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
86
|
+
I(e.el, "move", e.getMove({
|
|
87
|
+
x: C((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
88
|
+
y: C((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
89
89
|
}));
|
|
90
|
-
},
|
|
90
|
+
}, se = (e, t) => {
|
|
91
91
|
let n = t.keyCode;
|
|
92
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(),
|
|
92
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), I(e.el, "move", e.getMove({
|
|
93
93
|
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
94
94
|
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
95
95
|
}, !0)));
|
|
96
|
-
},
|
|
96
|
+
}, B = class {
|
|
97
97
|
constructor(e, t, n, r) {
|
|
98
|
-
let i =
|
|
98
|
+
let i = F(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
99
99
|
e.appendChild(i.content.cloneNode(!0));
|
|
100
100
|
let a = e.querySelector(`[part=${t}]`);
|
|
101
101
|
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
102
102
|
}
|
|
103
103
|
set dragging(e) {
|
|
104
104
|
let t = e ? document.addEventListener : document.removeEventListener;
|
|
105
|
-
t(
|
|
105
|
+
t(L ? "touchmove" : "mousemove", this), t(L ? "touchend" : "mouseup", this);
|
|
106
106
|
}
|
|
107
107
|
handleEvent(e) {
|
|
108
108
|
switch (e.type) {
|
|
109
109
|
case "mousedown":
|
|
110
110
|
case "touchstart":
|
|
111
|
-
if (e.preventDefault(), !
|
|
111
|
+
if (e.preventDefault(), !oe(e) || !L && e.button != 0) return;
|
|
112
112
|
this.el.focus(), z(this, e), this.dragging = !0;
|
|
113
113
|
break;
|
|
114
114
|
case "mousemove":
|
|
@@ -120,7 +120,7 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
120
120
|
this.dragging = !1;
|
|
121
121
|
break;
|
|
122
122
|
case "keydown":
|
|
123
|
-
|
|
123
|
+
se(this, e);
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -129,25 +129,25 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
129
129
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
},
|
|
132
|
+
}, V = class extends B {
|
|
133
133
|
constructor(e) {
|
|
134
134
|
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
135
135
|
}
|
|
136
136
|
update({ h: e }) {
|
|
137
137
|
this.h = e, this.style([{
|
|
138
138
|
left: `${e / 360 * 100}%`,
|
|
139
|
-
color:
|
|
139
|
+
color: k({
|
|
140
140
|
h: e,
|
|
141
141
|
s: 100,
|
|
142
142
|
v: 100,
|
|
143
143
|
a: 1
|
|
144
144
|
})
|
|
145
|
-
}]), this.el.setAttribute("aria-valuenow", `${
|
|
145
|
+
}]), this.el.setAttribute("aria-valuenow", `${w(e)}`);
|
|
146
146
|
}
|
|
147
147
|
getMove(e, t) {
|
|
148
|
-
return { h: t ?
|
|
148
|
+
return { h: t ? C(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
149
149
|
}
|
|
150
|
-
},
|
|
150
|
+
}, H = class extends B {
|
|
151
151
|
constructor(e) {
|
|
152
152
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
153
153
|
}
|
|
@@ -155,47 +155,47 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
155
155
|
this.hsva = e, this.style([{
|
|
156
156
|
top: `${100 - e.v}%`,
|
|
157
157
|
left: `${e.s}%`,
|
|
158
|
-
color:
|
|
159
|
-
}, { "background-color":
|
|
158
|
+
color: k(e)
|
|
159
|
+
}, { "background-color": k({
|
|
160
160
|
h: e.h,
|
|
161
161
|
s: 100,
|
|
162
162
|
v: 100,
|
|
163
163
|
a: 1
|
|
164
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${
|
|
164
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${w(e.s)}%, Brightness ${w(e.v)}%`);
|
|
165
165
|
}
|
|
166
166
|
getMove(e, t) {
|
|
167
167
|
return {
|
|
168
|
-
s: t ?
|
|
169
|
-
v: t ?
|
|
168
|
+
s: t ? C(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
169
|
+
v: t ? C(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
},
|
|
172
|
+
}, U = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", W = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", G = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", K = Symbol("same"), q = Symbol("color"), J = Symbol("hsva"), Y = Symbol("update"), X = Symbol("parts"), Z = Symbol("css"), Q = Symbol("sliders"), ce = class extends HTMLElement {
|
|
173
173
|
static get observedAttributes() {
|
|
174
174
|
return ["color"];
|
|
175
175
|
}
|
|
176
|
-
get [
|
|
176
|
+
get [Z]() {
|
|
177
177
|
return [
|
|
178
|
+
U,
|
|
178
179
|
W,
|
|
179
|
-
G
|
|
180
|
-
K
|
|
180
|
+
G
|
|
181
181
|
];
|
|
182
182
|
}
|
|
183
|
-
get [
|
|
184
|
-
return [
|
|
183
|
+
get [Q]() {
|
|
184
|
+
return [H, V];
|
|
185
185
|
}
|
|
186
186
|
get color() {
|
|
187
|
-
return this[
|
|
187
|
+
return this[q];
|
|
188
188
|
}
|
|
189
189
|
set color(e) {
|
|
190
|
-
if (!this[
|
|
190
|
+
if (!this[K](e)) {
|
|
191
191
|
let t = this.colorModel.toHsva(e);
|
|
192
|
-
this[
|
|
192
|
+
this[Y](t), this[q] = e;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
constructor() {
|
|
196
196
|
super();
|
|
197
|
-
let e =
|
|
198
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[
|
|
197
|
+
let e = F(`<style>${this[Z].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
198
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[X] = this[Q].map((e) => new e(t));
|
|
199
199
|
}
|
|
200
200
|
connectedCallback() {
|
|
201
201
|
if (this.hasOwnProperty("color")) {
|
|
@@ -205,57 +205,60 @@ var re = (e) => oe(E(e)), E = (e) => (e[0] === "#" && (e = e.substring(1)), e.le
|
|
|
205
205
|
}
|
|
206
206
|
attributeChangedCallback(e, t, n) {
|
|
207
207
|
let r = this.colorModel.fromAttr(n);
|
|
208
|
-
this[
|
|
208
|
+
this[K](r) || (this.color = r);
|
|
209
209
|
}
|
|
210
210
|
handleEvent(e) {
|
|
211
|
-
let t = this[
|
|
211
|
+
let t = this[J], n = {
|
|
212
212
|
...t,
|
|
213
213
|
...e.detail
|
|
214
214
|
};
|
|
215
|
-
this[
|
|
215
|
+
this[Y](n);
|
|
216
216
|
let r;
|
|
217
|
-
!
|
|
217
|
+
!M(n, t) && !this[K](r = this.colorModel.fromHsva(n)) && (this[q] = r, I(this, "color-changed", { value: r }));
|
|
218
218
|
}
|
|
219
|
-
[
|
|
219
|
+
[K](e) {
|
|
220
220
|
return this.color && this.colorModel.equal(e, this.color);
|
|
221
221
|
}
|
|
222
|
-
[
|
|
223
|
-
this[
|
|
222
|
+
[Y](e) {
|
|
223
|
+
this[J] = e, this[X].forEach((t) => t.update(e));
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, le = {
|
|
226
226
|
defaultColor: "#000",
|
|
227
|
-
toHsva:
|
|
228
|
-
fromHsva: ({ h: e, s: t, v: n }) =>
|
|
227
|
+
toHsva: T,
|
|
228
|
+
fromHsva: ({ h: e, s: t, v: n }) => D({
|
|
229
229
|
h: e,
|
|
230
230
|
s: t,
|
|
231
231
|
v: n,
|
|
232
232
|
a: 1
|
|
233
233
|
}),
|
|
234
|
-
equal:
|
|
234
|
+
equal: N,
|
|
235
235
|
fromAttr: (e) => e
|
|
236
|
-
},
|
|
236
|
+
}, ue = class extends ce {
|
|
237
237
|
get colorModel() {
|
|
238
|
-
return
|
|
238
|
+
return le;
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
customElements.define("hex-color-picker", class extends
|
|
241
|
+
customElements.define("hex-color-picker", class extends ue {});
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
244
|
-
var
|
|
244
|
+
var de = [
|
|
245
245
|
"disabled",
|
|
246
246
|
"aria-label",
|
|
247
247
|
"aria-expanded"
|
|
248
|
-
],
|
|
248
|
+
], fe = {
|
|
249
|
+
key: 0,
|
|
250
|
+
class: "tpl:relative tpl:flex-1"
|
|
251
|
+
}, pe = [
|
|
249
252
|
"value",
|
|
250
253
|
"placeholder",
|
|
251
254
|
"disabled",
|
|
252
255
|
"aria-label"
|
|
253
|
-
],
|
|
256
|
+
], me = ["aria-label", "title"], $ = ["color", "aria-label"], he = /* @__PURE__ */ v({
|
|
254
257
|
__name: "ColorPicker",
|
|
255
258
|
props: {
|
|
256
259
|
modelValue: {},
|
|
257
|
-
placeholder: { default:
|
|
258
|
-
|
|
260
|
+
placeholder: { default: "" },
|
|
261
|
+
seedColor: { default: "#ffffff" },
|
|
259
262
|
swatchOnly: {
|
|
260
263
|
type: Boolean,
|
|
261
264
|
default: !1
|
|
@@ -267,21 +270,27 @@ var ue = [
|
|
|
267
270
|
},
|
|
268
271
|
emits: ["update:modelValue"],
|
|
269
272
|
setup(e, { emit: t }) {
|
|
270
|
-
let r = e, s = t, { t: f } = ee(), _ = a(!1), v = a(), b = a();
|
|
271
|
-
|
|
273
|
+
let r = e, s = t, { t: f } = ee(), _ = a(!1), v = a(), b = a(), x = a(!1);
|
|
274
|
+
ne(v, () => {
|
|
272
275
|
_.value = !1;
|
|
273
276
|
}, { ignore: [b] });
|
|
274
|
-
let
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
function
|
|
279
|
-
x.value =
|
|
277
|
+
let S = c(() => !r.modelValue), C = c(() => r.modelValue || r.seedColor), w = c(() => !r.swatchOnly && !r.disabled && !S.value);
|
|
278
|
+
function T(e) {
|
|
279
|
+
x.value = !0, s("update:modelValue", e.detail.value);
|
|
280
|
+
}
|
|
281
|
+
function E() {
|
|
282
|
+
x.value = !1;
|
|
283
|
+
}
|
|
284
|
+
function D() {
|
|
285
|
+
!x.value && S.value && s("update:modelValue", C.value);
|
|
280
286
|
}
|
|
281
|
-
function
|
|
282
|
-
|
|
287
|
+
function O(e) {
|
|
288
|
+
s("update:modelValue", e.target.value);
|
|
283
289
|
}
|
|
284
|
-
|
|
290
|
+
function k() {
|
|
291
|
+
s("update:modelValue", "");
|
|
292
|
+
}
|
|
293
|
+
return (t, r) => (n(), l("div", { class: m(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
285
294
|
h("button", {
|
|
286
295
|
ref_key: "swatchRef",
|
|
287
296
|
ref: b,
|
|
@@ -293,23 +302,33 @@ var ue = [
|
|
|
293
302
|
"tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
294
303
|
e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
295
304
|
_.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
296
|
-
|
|
305
|
+
"tpl:size-10"
|
|
297
306
|
]),
|
|
298
307
|
onClick: r[0] ||= (t) => !e.disabled && (_.value = !_.value)
|
|
299
308
|
}, [h("span", {
|
|
300
|
-
class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
|
|
301
|
-
style: g({ backgroundColor:
|
|
302
|
-
}, null,
|
|
303
|
-
e.swatchOnly ? u("", !0) : (n(), l("input", {
|
|
304
|
-
key: 0,
|
|
309
|
+
class: m(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": S.value }]),
|
|
310
|
+
style: g(S.value ? void 0 : { backgroundColor: e.modelValue })
|
|
311
|
+
}, null, 6)], 10, de),
|
|
312
|
+
e.swatchOnly ? u("", !0) : (n(), l("div", fe, [h("input", {
|
|
305
313
|
type: "text",
|
|
306
|
-
class: m(d(
|
|
314
|
+
class: m([d(re), "tpl:w-full"]),
|
|
315
|
+
style: g(w.value ? { paddingRight: "2.25rem" } : void 0),
|
|
307
316
|
value: e.modelValue,
|
|
308
|
-
placeholder: e.placeholder,
|
|
317
|
+
placeholder: e.placeholder || d(f).colorPicker.notSet,
|
|
309
318
|
disabled: e.disabled,
|
|
310
319
|
"aria-label": d(f).colorPicker.hexValue,
|
|
311
|
-
onInput:
|
|
312
|
-
}, null,
|
|
320
|
+
onInput: O
|
|
321
|
+
}, null, 46, pe), w.value ? (n(), l("button", {
|
|
322
|
+
key: 0,
|
|
323
|
+
type: "button",
|
|
324
|
+
"aria-label": d(f).colorPicker.clear,
|
|
325
|
+
title: d(f).colorPicker.clear,
|
|
326
|
+
class: "tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]",
|
|
327
|
+
onClick: k
|
|
328
|
+
}, [y(d(te), {
|
|
329
|
+
size: 14,
|
|
330
|
+
"stroke-width": 1.5
|
|
331
|
+
})], 8, me)) : u("", !0)])),
|
|
313
332
|
y(p, {
|
|
314
333
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
315
334
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
@@ -324,21 +343,23 @@ var ue = [
|
|
|
324
343
|
ref: v,
|
|
325
344
|
class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
|
|
326
345
|
}, [h("hex-color-picker", {
|
|
327
|
-
color:
|
|
346
|
+
color: C.value,
|
|
328
347
|
"aria-label": d(f).colorPicker.pickColor,
|
|
329
|
-
onColorChanged:
|
|
348
|
+
onColorChanged: T,
|
|
349
|
+
onPointerdown: E,
|
|
350
|
+
onPointerup: D,
|
|
330
351
|
onKeydown: r[1] ||= o((e) => _.value = !1, ["escape"])
|
|
331
|
-
}, null, 40,
|
|
352
|
+
}, null, 40, $)], 512)) : u("", !0)]),
|
|
332
353
|
_: 1
|
|
333
354
|
})
|
|
334
355
|
], 2));
|
|
335
356
|
}
|
|
336
|
-
}),
|
|
357
|
+
}), ge = [
|
|
337
358
|
"aria-checked",
|
|
338
359
|
"aria-label",
|
|
339
360
|
"title",
|
|
340
361
|
"onClick"
|
|
341
|
-
],
|
|
362
|
+
], _e = { key: 1 }, ve = /* @__PURE__ */ v({
|
|
342
363
|
__name: "SlidingPillSelect",
|
|
343
364
|
props: {
|
|
344
365
|
options: {},
|
|
@@ -381,22 +402,22 @@ var ue = [
|
|
|
381
402
|
key: 0,
|
|
382
403
|
size: 14,
|
|
383
404
|
"stroke-width": 2
|
|
384
|
-
})) : (n(), l("span",
|
|
405
|
+
})) : (n(), l("span", _e, s(r.label), 1))], 12, ge))), 128))], 4));
|
|
385
406
|
}
|
|
386
|
-
}),
|
|
407
|
+
}), ye = { class: "tpl:mb-3.5" }, be = /* @__PURE__ */ v({
|
|
387
408
|
__name: "FieldRow",
|
|
388
409
|
props: { label: {} },
|
|
389
410
|
setup(t) {
|
|
390
|
-
return (r, i) => (n(), l("div",
|
|
411
|
+
return (r, i) => (n(), l("div", ye, [t.label ? (n(), l("label", {
|
|
391
412
|
key: 0,
|
|
392
413
|
class: m(d(b))
|
|
393
414
|
}, s(t.label), 3)) : u("", !0), e(r.$slots, "default")]));
|
|
394
415
|
}
|
|
395
|
-
}),
|
|
416
|
+
}), xe = { class: "tpl:flex tpl:items-stretch" }, Se = [
|
|
396
417
|
"value",
|
|
397
418
|
"min",
|
|
398
419
|
"max"
|
|
399
|
-
],
|
|
420
|
+
], Ce = /* @__PURE__ */ v({
|
|
400
421
|
__name: "NumberWithSuffix",
|
|
401
422
|
props: {
|
|
402
423
|
modelValue: {},
|
|
@@ -407,17 +428,17 @@ var ue = [
|
|
|
407
428
|
emits: ["update:modelValue"],
|
|
408
429
|
setup(e, { emit: t }) {
|
|
409
430
|
let r = t;
|
|
410
|
-
return (t, i) => (n(), l("div",
|
|
431
|
+
return (t, i) => (n(), l("div", xe, [h("input", {
|
|
411
432
|
type: "number",
|
|
412
|
-
class: m(d(
|
|
433
|
+
class: m(d(S)),
|
|
413
434
|
value: e.modelValue,
|
|
414
435
|
min: e.min,
|
|
415
436
|
max: e.max,
|
|
416
437
|
onInput: i[0] ||= (e) => r("update:modelValue", Number(e.target.value))
|
|
417
|
-
}, null, 42,
|
|
438
|
+
}, null, 42, Se), h("span", { class: m(d(x)) }, s(e.suffix), 3)]));
|
|
418
439
|
}
|
|
419
440
|
});
|
|
420
441
|
//#endregion
|
|
421
|
-
export {
|
|
442
|
+
export { he as i, be as n, ve as r, Ce as t };
|
|
422
443
|
|
|
423
|
-
//# sourceMappingURL=NumberWithSuffix-
|
|
444
|
+
//# sourceMappingURL=NumberWithSuffix-cdWjAK6y.js.map
|