@arkyn/components 3.0.9 → 3.0.10

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 (35) hide show
  1. package/dist/components/calendar/_calendarProvider.d.ts.map +1 -1
  2. package/dist/components/datePicker/datePickerCalendarContainer/index.d.ts.map +1 -1
  3. package/dist/components/googleAnalytics/snippets/generateGAElements.d.ts.map +1 -1
  4. package/dist/components/googleTagManager/snippets/appendToDataLayer.d.ts.map +1 -1
  5. package/dist/components/googleTagManager/snippets/generateGTMElements.d.ts.map +1 -1
  6. package/dist/components/multiSelect/multiSelectOptionsContainer/index.d.ts.map +1 -1
  7. package/dist/components/richText/index.d.ts.map +1 -1
  8. package/dist/components/select/selectOptionsContainer/index.d.ts.map +1 -1
  9. package/dist/hooks/useFlipPosition.d.ts +38 -0
  10. package/dist/hooks/useFlipPosition.d.ts.map +1 -0
  11. package/dist/index.js +538 -511
  12. package/dist/index.js.map +1 -1
  13. package/dist/modules/components/calendar/_calendarProvider.js +47 -34
  14. package/dist/modules/components/calendar/_calendarProvider.js.map +1 -1
  15. package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js +12 -19
  16. package/dist/modules/components/datePicker/datePickerCalendarContainer/index.js.map +1 -1
  17. package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +7 -6
  18. package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js.map +1 -1
  19. package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +7 -6
  20. package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js.map +1 -1
  21. package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +20 -14
  22. package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js.map +1 -1
  23. package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +21 -28
  24. package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js.map +1 -1
  25. package/dist/modules/components/richText/index.js +1 -1
  26. package/dist/modules/components/richText/index.js.map +1 -1
  27. package/dist/modules/components/select/selectOptionsContainer/index.js +21 -28
  28. package/dist/modules/components/select/selectOptionsContainer/index.js.map +1 -1
  29. package/dist/modules/hooks/useFlipPosition.js +26 -0
  30. package/dist/modules/hooks/useFlipPosition.js.map +1 -0
  31. package/dist/modules/utils/escapeForInlineScript.js +14 -0
  32. package/dist/modules/utils/escapeForInlineScript.js.map +1 -0
  33. package/dist/utils/escapeForInlineScript.d.ts +23 -0
  34. package/dist/utils/escapeForInlineScript.d.ts.map +1 -0
  35. package/package.json +9 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeForInlineScript.js","names":[],"sources":["../../../src/utils/escapeForInlineScript.ts"],"sourcesContent":["/**\n * Serializes a value so it can be embedded as a JS string literal inside an inline\n * `<script>` snippet. Wraps `JSON.stringify` (which already escapes quotes/backslashes/\n * control characters) and additionally escapes `<` so a value containing `</script>`\n * can't prematurely close the surrounding script tag.\n *\n * @example\n * ```typescript\n * `gtag('config', ${toSafeScriptString(measurementId)});`\n * // measurementId = \"G-XXXX\" -> gtag('config', \"G-XXXX\");\n * // measurementId = \"\\\"); alert(1); //\" -> gtag('config', \"\\\"); alert(1); //\");\n * ```\n */\nfunction toSafeScriptString(value: unknown): string {\n\treturn JSON.stringify(value ?? \"\").replace(/</g, \"\\\\u003C\");\n}\n\n/**\n * Serializes an object/array to JSON for embedding inside an inline `<script>` snippet,\n * escaping `<` so a value containing `</script>` can't prematurely close the script tag.\n */\nfunction toSafeScriptJson(value: unknown): string {\n\treturn JSON.stringify(value).replace(/</g, \"\\\\u003C\");\n}\n\n/** Whether `name` is a valid bare JS identifier (safe to use as `window.<name>`). */\nfunction isValidJsIdentifier(name: string): boolean {\n\treturn /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name);\n}\n\nexport { isValidJsIdentifier, toSafeScriptJson, toSafeScriptString };\n"],"mappings":";AAaA,SAAS,EAAmB,GAAwB;CACnD,OAAO,KAAK,UAAU,KAAS,EAAE,CAAC,CAAC,QAAQ,MAAM,SAAS;AAC3D;AAMA,SAAS,EAAiB,GAAwB;CACjD,OAAO,KAAK,UAAU,CAAK,CAAC,CAAC,QAAQ,MAAM,SAAS;AACrD;AAGA,SAAS,EAAoB,GAAuB;CACnD,OAAO,6BAA6B,KAAK,CAAI;AAC9C"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Serializes a value so it can be embedded as a JS string literal inside an inline
3
+ * `<script>` snippet. Wraps `JSON.stringify` (which already escapes quotes/backslashes/
4
+ * control characters) and additionally escapes `<` so a value containing `</script>`
5
+ * can't prematurely close the surrounding script tag.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * `gtag('config', ${toSafeScriptString(measurementId)});`
10
+ * // measurementId = "G-XXXX" -> gtag('config', "G-XXXX");
11
+ * // measurementId = "\"); alert(1); //" -> gtag('config', "\"); alert(1); //");
12
+ * ```
13
+ */
14
+ declare function toSafeScriptString(value: unknown): string;
15
+ /**
16
+ * Serializes an object/array to JSON for embedding inside an inline `<script>` snippet,
17
+ * escaping `<` so a value containing `</script>` can't prematurely close the script tag.
18
+ */
19
+ declare function toSafeScriptJson(value: unknown): string;
20
+ /** Whether `name` is a valid bare JS identifier (safe to use as `window.<name>`). */
21
+ declare function isValidJsIdentifier(name: string): boolean;
22
+ export { isValidJsIdentifier, toSafeScriptJson, toSafeScriptString };
23
+ //# sourceMappingURL=escapeForInlineScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeForInlineScript.d.ts","sourceRoot":"","sources":["../../src/utils/escapeForInlineScript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElD;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED,qFAAqF;AACrF,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -48,13 +48,13 @@
48
48
  "prebuild": "rm -rf dist",
49
49
  "publish:beta": "bash ../../scripts/publish-idempotent.sh beta",
50
50
  "publish:latest": "bash ../../scripts/publish-idempotent.sh latest",
51
- "release:beta": "bun ./generate-version.ts beta",
52
- "release:patch": "bun ./generate-version.ts patch",
53
- "release:minor": "bun ./generate-version.ts minor",
54
- "release:major": "bun ./generate-version.ts major",
51
+ "release:beta": "bun ../../scripts/generate-version.ts beta",
52
+ "release:patch": "bun ../../scripts/generate-version.ts patch",
53
+ "release:minor": "bun ../../scripts/generate-version.ts minor",
54
+ "release:major": "bun ../../scripts/generate-version.ts major",
55
55
  "test": "bunx vitest --config vitest.config.ts --run",
56
56
  "test:watch": "bunx vitest --config vitest.config.ts --watch",
57
- "typecheck": "bunx tsc --project tsconfig.json --noEmit"
57
+ "typecheck": "bunx tsc --project tsconfig.json --noEmit && bunx tsc --project tsconfig.scripts.json --noEmit"
58
58
  },
59
59
  "sideEffects": [
60
60
  "*.css"
@@ -123,11 +123,14 @@
123
123
  "@types/react-dom": "^19.2.3",
124
124
  "@types/react-scroll": "^1.8.10",
125
125
  "@vitejs/plugin-react": "^6.0.3",
126
+ "@vitest/browser": "4.1.11",
127
+ "@vitest/browser-playwright": "4.1.11",
126
128
  "html-react-parser": "6.1.7",
127
129
  "is-hotkey": "^0.2.0",
128
130
  "jsdom": "^30.0.1",
129
131
  "lucide-react": "catalog:",
130
132
  "mapbox-gl": "^3.25.0",
133
+ "playwright": "^1.62.1",
131
134
  "postcss": "^8.5.16",
132
135
  "react": "^19.2.7",
133
136
  "react-dom": "^19.2.7",