@studiometa/ui 1.0.0-beta.1 → 1.0.0-rc.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.
Files changed (84) hide show
  1. package/AnchorScrollTo/AnchorScrollTo.d.ts +2 -2
  2. package/AnchorScrollTo/AnchorScrollTo.js +0 -1
  3. package/AnchorScrollTo/AnchorScrollTo.js.map +2 -2
  4. package/Button/Button.twig +12 -9
  5. package/Button/StyledButton.twig +40 -5
  6. package/Button/StyledButtonRounded.twig +12 -42
  7. package/CircularMarquee/CircularMarquee.twig +30 -18
  8. package/Data/DataBind.js +1 -1
  9. package/Data/DataBind.js.map +2 -2
  10. package/Draggable/Draggable.js +7 -2
  11. package/Draggable/Draggable.js.map +2 -2
  12. package/Figure/Figure.d.ts +1 -0
  13. package/Figure/Figure.js.map +2 -2
  14. package/Frame/AbstractFrameTrigger.d.ts +43 -0
  15. package/Frame/AbstractFrameTrigger.js +72 -0
  16. package/Frame/AbstractFrameTrigger.js.map +7 -0
  17. package/Frame/Frame.d.ts +55 -27
  18. package/Frame/Frame.js +132 -138
  19. package/Frame/Frame.js.map +3 -3
  20. package/Frame/FrameAnchor.d.ts +7 -4
  21. package/Frame/FrameAnchor.js +8 -5
  22. package/Frame/FrameAnchor.js.map +2 -2
  23. package/Frame/FrameForm.d.ts +22 -4
  24. package/Frame/FrameForm.js +43 -6
  25. package/Frame/FrameForm.js.map +2 -2
  26. package/Frame/FrameLoader.d.ts +22 -0
  27. package/Frame/FrameLoader.js +22 -0
  28. package/Frame/FrameLoader.js.map +7 -0
  29. package/Frame/FrameTarget.d.ts +6 -17
  30. package/Frame/FrameTarget.js +25 -60
  31. package/Frame/FrameTarget.js.map +2 -2
  32. package/Frame/FrameTriggerLoader.d.ts +13 -0
  33. package/Frame/FrameTriggerLoader.js +13 -0
  34. package/Frame/FrameTriggerLoader.js.map +7 -0
  35. package/Frame/index.d.ts +4 -0
  36. package/Frame/index.js +4 -0
  37. package/Frame/index.js.map +2 -2
  38. package/Frame/types.d.ts +12 -0
  39. package/Frame/types.js +1 -0
  40. package/Frame/types.js.map +7 -0
  41. package/Frame/utils.d.ts +9 -0
  42. package/Frame/utils.js +13 -0
  43. package/Frame/utils.js.map +7 -0
  44. package/LICENSE.md +110 -0
  45. package/Reinsurance/Reinsurance.twig +6 -6
  46. package/Slider/AbstractSliderChild.d.ts +5 -9
  47. package/Slider/AbstractSliderChild.js +0 -11
  48. package/Slider/AbstractSliderChild.js.map +2 -2
  49. package/Slider/Slider.d.ts +23 -30
  50. package/Slider/Slider.js +40 -100
  51. package/Slider/Slider.js.map +2 -2
  52. package/Slider/SliderBtn.d.ts +0 -3
  53. package/Slider/SliderBtn.js +3 -7
  54. package/Slider/SliderBtn.js.map +2 -2
  55. package/Slider/SliderCount.d.ts +0 -2
  56. package/Slider/SliderCount.js +4 -3
  57. package/Slider/SliderCount.js.map +2 -2
  58. package/Slider/SliderDots.d.ts +0 -3
  59. package/Slider/SliderDots.js +6 -7
  60. package/Slider/SliderDots.js.map +2 -2
  61. package/Slider/SliderDrag.d.ts +0 -2
  62. package/Slider/SliderDrag.js +0 -2
  63. package/Slider/SliderDrag.js.map +2 -2
  64. package/Slider/SliderItem.d.ts +10 -26
  65. package/Slider/SliderItem.js +9 -41
  66. package/Slider/SliderItem.js.map +2 -2
  67. package/Tabs/Tabs.twig +73 -9
  68. package/decorators/withTransition.d.ts +4 -0
  69. package/decorators/withTransition.js +40 -45
  70. package/decorators/withTransition.js.map +2 -2
  71. package/index.d.ts +0 -1
  72. package/index.js +0 -1
  73. package/index.js.map +2 -2
  74. package/package.json +4 -3
  75. package/LICENSE +0 -21
  76. package/TableOfContent/TableOfContent.d.ts +0 -39
  77. package/TableOfContent/TableOfContent.js +0 -50
  78. package/TableOfContent/TableOfContent.js.map +0 -7
  79. package/TableOfContent/TableOfContentAnchor.d.ts +0 -36
  80. package/TableOfContent/TableOfContentAnchor.js +0 -54
  81. package/TableOfContent/TableOfContentAnchor.js.map +0 -7
  82. package/TableOfContent/index.d.ts +0 -2
  83. package/TableOfContent/index.js +0 -3
  84. package/TableOfContent/index.js.map +0 -7
@@ -1,16 +1,53 @@
1
- import { Base } from "@studiometa/js-toolkit";
2
- class FrameForm extends Base {
1
+ import { AbstractFrameTrigger } from "./AbstractFrameTrigger.js";
2
+ class FrameForm extends AbstractFrameTrigger {
3
3
  /**
4
4
  * Config.
5
5
  */
6
6
  static config = {
7
- name: "FrameForm"
7
+ name: "FrameForm",
8
+ refs: ["headers[]"]
8
9
  };
9
10
  /**
10
- * Get the form action.
11
+ * Form submission method.
11
12
  */
12
- get action() {
13
- return this.$el.action;
13
+ get method() {
14
+ return this.$el.method.toLowerCase();
15
+ }
16
+ /**
17
+ * Add params to the requested URL for GET submissions.
18
+ */
19
+ get url() {
20
+ const url = new URL(this.$el.action);
21
+ if (this.method === "get") {
22
+ url.search = new URLSearchParams(new FormData(this.$el)).toString();
23
+ }
24
+ return url;
25
+ }
26
+ /**
27
+ * Add body to the request for POST submissions.
28
+ */
29
+ get requestInit() {
30
+ const requestInit = { ...super.requestInit };
31
+ requestInit.headers ??= {};
32
+ for (const header of this.$refs.headers) {
33
+ if (header.dataset.name && header.value) {
34
+ requestInit.headers[header.dataset.name] = header.value;
35
+ }
36
+ }
37
+ if (this.method === "post") {
38
+ requestInit.method = this.method;
39
+ requestInit.body = new FormData(this.$el);
40
+ }
41
+ return requestInit;
42
+ }
43
+ /**
44
+ * Prevent submit on forms.
45
+ */
46
+ onSubmit({ event }) {
47
+ if (this.$el.target !== "_blank") {
48
+ event.preventDefault();
49
+ this.trigger();
50
+ }
14
51
  }
15
52
  }
16
53
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/ui/Frame/FrameForm.ts"],
4
- "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\n\nexport interface FrameFormProps extends BaseProps {\n $el: HTMLFormElement;\n}\n\n/**\n * FrameForm class.\n */\nexport class FrameForm<T extends BaseProps = BaseProps> extends Base<T & FrameFormProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'FrameForm',\n };\n\n /**\n * Get the form action.\n */\n get action(): string {\n return this.$el.action;\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,YAAY;AAUd,MAAM,kBAAmD,KAAyB;AAAA;AAAA;AAAA;AAAA,EAIvF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAiB;AACnB,WAAO,KAAK,IAAI;AAAA,EAClB;AACF;",
4
+ "sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { AbstractFrameTrigger } from './AbstractFrameTrigger.js';\n\nexport interface FrameFormProps extends BaseProps {\n $el: HTMLFormElement;\n $refs: {\n headers: HTMLInputElement[];\n };\n}\n\n/**\n * FrameForm class.\n */\nexport class FrameForm<T extends BaseProps = BaseProps> extends AbstractFrameTrigger<\n T & FrameFormProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'FrameForm',\n refs: ['headers[]'],\n };\n\n /**\n * Form submission method.\n */\n get method() {\n return this.$el.method.toLowerCase() as 'post' | 'get';\n }\n\n /**\n * Add params to the requested URL for GET submissions.\n */\n get url(): URL {\n const url = new URL(this.$el.action);\n\n if (this.method === 'get') {\n // @ts-expect-error URLSearchParams accepts FormData as parameter in the browser.\n url.search = new URLSearchParams(new FormData(this.$el)).toString();\n }\n\n return url;\n }\n\n /**\n * Add body to the request for POST submissions.\n */\n get requestInit(): RequestInit {\n const requestInit = { ...super.requestInit };\n requestInit.headers ??= {};\n\n for (const header of this.$refs.headers) {\n if (header.dataset.name && header.value) {\n requestInit.headers[header.dataset.name] = header.value;\n }\n }\n\n if (this.method === 'post') {\n requestInit.method = this.method;\n requestInit.body = new FormData(this.$el);\n }\n\n return requestInit;\n }\n\n /**\n * Prevent submit on forms.\n */\n onSubmit({ event }: { event: SubmitEvent; target: FrameForm }) {\n if (this.$el.target !== '_blank') {\n event.preventDefault();\n this.trigger();\n }\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,4BAA4B;AAY9B,MAAM,kBAAmD,qBAE9D;AAAA;AAAA;AAAA;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,WAAW;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO,KAAK,IAAI,OAAO,YAAY;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,MAAW;AACb,UAAM,MAAM,IAAI,IAAI,KAAK,IAAI,MAAM;AAEnC,QAAI,KAAK,WAAW,OAAO;AAEzB,UAAI,SAAS,IAAI,gBAAgB,IAAI,SAAS,KAAK,GAAG,CAAC,EAAE,SAAS;AAAA,IACpE;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,cAA2B;AAC7B,UAAM,cAAc,EAAE,GAAG,MAAM,YAAY;AAC3C,gBAAY,YAAY,CAAC;AAEzB,eAAW,UAAU,KAAK,MAAM,SAAS;AACvC,UAAI,OAAO,QAAQ,QAAQ,OAAO,OAAO;AACvC,oBAAY,QAAQ,OAAO,QAAQ,IAAI,IAAI,OAAO;AAAA,MACpD;AAAA,IACF;AAEA,QAAI,KAAK,WAAW,QAAQ;AAC1B,kBAAY,SAAS,KAAK;AAC1B,kBAAY,OAAO,IAAI,SAAS,KAAK,GAAG;AAAA,IAC1C;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,EAAE,MAAM,GAA8C;AAC7D,QAAI,KAAK,IAAI,WAAW,UAAU;AAChC,YAAM,eAAe;AACrB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,22 @@
1
+ import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
2
+ import { Transition } from '../Transition/index.js';
3
+ import type { TransitionProps } from '../decorators/withTransition.js';
4
+ export interface FrameLoaderProps extends BaseProps {
5
+ $options: TransitionProps['$options'] & {
6
+ enterKeep: true;
7
+ leaveKeep: true;
8
+ };
9
+ }
10
+ /**
11
+ * Class.
12
+ */
13
+ export declare class FrameLoader<T extends BaseProps = BaseProps> extends Transition<T & FrameLoaderProps> {
14
+ /**
15
+ * Config.
16
+ */
17
+ static config: BaseConfig;
18
+ get $options(): import("@studiometa/js-toolkit").BaseOptions & (T & FrameLoaderProps & TransitionProps)["$options"] & {
19
+ enterKeep: boolean;
20
+ leaveKeep: boolean;
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { Transition } from "../Transition/index.js";
2
+ class FrameLoader extends Transition {
3
+ /**
4
+ * Config.
5
+ */
6
+ static config = {
7
+ name: "FrameLoader"
8
+ };
9
+ // @ts-expect-error this is fine.
10
+ get $options() {
11
+ const options = super.$options;
12
+ return {
13
+ ...options,
14
+ enterKeep: true,
15
+ leaveKeep: true
16
+ };
17
+ }
18
+ }
19
+ export {
20
+ FrameLoader
21
+ };
22
+ //# sourceMappingURL=FrameLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/ui/Frame/FrameLoader.ts"],
4
+ "sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { Transition } from '../Transition/index.js';\nimport type { TransitionProps } from '../decorators/withTransition.js';\n\nexport interface FrameLoaderProps extends BaseProps {\n $options: TransitionProps['$options'] & {\n enterKeep: true;\n leaveKeep: true;\n };\n}\n\n/**\n * Class.\n */\nexport class FrameLoader<T extends BaseProps = BaseProps> extends Transition<T & FrameLoaderProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'FrameLoader',\n };\n\n // @ts-expect-error this is fine.\n get $options() {\n const options = super.$options;\n\n return {\n ...options,\n enterKeep: true,\n leaveKeep: true,\n };\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,kBAAkB;AAapB,MAAM,oBAAqD,WAAiC;AAAA;AAAA;AAAA;AAAA,EAIjG,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,WAAW;AACb,UAAM,UAAU,MAAM;AAEtB,WAAO;AAAA,MACL,GAAG;AAAA,MACH,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -3,8 +3,6 @@ import { Transition } from '../Transition/index.js';
3
3
  export interface FrameTargetProps extends BaseProps {
4
4
  $options: {
5
5
  mode: 'replace' | 'prepend' | 'append';
6
- id: string;
7
- leaveKeep: true;
8
6
  };
9
7
  }
10
8
  /**
@@ -16,28 +14,19 @@ export declare class FrameTarget<T extends BaseProps = BaseProps> extends Transi
16
14
  */
17
15
  static config: BaseConfig;
18
16
  /**
19
- * Insert modes.
17
+ * Different mode of content insertion.
20
18
  */
21
- static __INSERT_MODES: {
22
- readonly prepend: "afterbegin";
23
- readonly append: "beforeend";
19
+ modes: {
20
+ readonly APPEND: "append";
21
+ readonly PREPEND: "prepend";
22
+ readonly REPLACE: "replace";
24
23
  };
25
- /**
26
- * Override options.
27
- */
28
- get $options(): import("@studiometa/js-toolkit").BaseOptions & (T & FrameTargetProps & import("../index.js").TransitionProps)["$options"];
29
24
  /**
30
25
  * Get uniq ID.
31
26
  */
32
27
  get id(): string;
33
- /**
34
- * Enter transition.
35
- */
36
- enter(): Promise<void>;
37
28
  /**
38
29
  * Update the content from the new target.
39
- * @param {FrameTarget} newTarget The instance of the new target.
40
- * @returns {void}
41
30
  */
42
- updateContent(newTarget: FrameTarget): void;
31
+ updateContent(content?: Element): Promise<void>;
43
32
  }
@@ -1,88 +1,53 @@
1
- import { addClass, transition } from "@studiometa/js-toolkit/utils";
2
1
  import { Transition } from "../Transition/index.js";
2
+ import morphdom from "morphdom";
3
3
  class FrameTarget extends Transition {
4
4
  /**
5
5
  * Config.
6
6
  */
7
7
  static config = {
8
- ...Transition.config,
9
8
  name: "FrameTarget",
10
- log: true,
11
9
  options: {
12
- ...Transition.config.options,
13
10
  mode: {
14
11
  type: String,
15
12
  default: "replace"
16
13
  // or 'prepend' or 'append'
17
- },
18
- id: String
14
+ }
19
15
  }
20
16
  };
21
17
  /**
22
- * Insert modes.
18
+ * Different mode of content insertion.
23
19
  */
24
- static __INSERT_MODES = {
25
- prepend: "afterbegin",
26
- append: "beforeend"
20
+ modes = {
21
+ APPEND: "append",
22
+ PREPEND: "prepend",
23
+ REPLACE: "replace"
27
24
  };
28
- /**
29
- * Override options.
30
- */
31
- // @ts-ignore
32
- get $options() {
33
- const options = super.$options;
34
- options.leaveKeep = true;
35
- return options;
36
- }
37
25
  /**
38
26
  * Get uniq ID.
39
27
  */
40
28
  get id() {
41
- return this.$options.id ?? this.$el.id;
42
- }
43
- /**
44
- * Enter transition.
45
- */
46
- async enter() {
47
- this.$log("enter");
48
- const { enterFrom: from, enterActive: active, enterTo: to, leaveTo, enterKeep } = this.$options;
49
- const transitionStyles = { from, active, to };
50
- switch (this.$options.mode) {
51
- case "append":
52
- case "prepend":
53
- await Promise.all(
54
- Array.from(this.$el.children).filter(
55
- (child) => from.split(" ").every((className) => child.classList.contains(className))
56
- ).map(
57
- (child) => transition(child, transitionStyles, enterKeep ? "keep" : void 0)
58
- )
59
- );
60
- break;
61
- case "replace":
62
- default:
63
- transitionStyles.from = Array.from(new Set([from, leaveTo].flat())).join(" ");
64
- await transition(this.$el, transitionStyles, enterKeep ? "keep" : void 0);
65
- }
29
+ return this.$el.id;
66
30
  }
67
31
  /**
68
32
  * Update the content from the new target.
69
- * @param {FrameTarget} newTarget The instance of the new target.
70
- * @returns {void}
71
33
  */
72
- updateContent(newTarget) {
73
- switch (this.$options.mode) {
74
- case "prepend":
75
- case "append":
76
- addClass(Array.from(newTarget.$el.children), this.$options.enterFrom.split(" "));
77
- this.$el.insertAdjacentHTML(
78
- FrameTarget.__INSERT_MODES[this.$options.mode],
79
- newTarget.$el.innerHTML
80
- );
81
- break;
82
- case "replace":
83
- default:
84
- this.$el.innerHTML = newTarget.$el.innerHTML;
85
- break;
34
+ async updateContent(content = null) {
35
+ if (!content) {
36
+ return;
37
+ }
38
+ const { mode } = this.$options;
39
+ if (mode === this.modes.APPEND || mode === this.modes.PREPEND) {
40
+ const leaveTargets = Array.from(this.$el.children);
41
+ const enterTargets = Array.from(content.children);
42
+ this.$el[mode](...Array.from(content.childNodes));
43
+ await Promise.all([
44
+ this.leave(leaveTargets),
45
+ this.enter(enterTargets)
46
+ ]);
47
+ } else {
48
+ await this.leave();
49
+ morphdom(this.$el, content);
50
+ await this.enter();
86
51
  }
87
52
  }
88
53
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/ui/Frame/FrameTarget.ts"],
4
- "sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { addClass, transition } from '@studiometa/js-toolkit/utils';\nimport { Transition } from '../Transition/index.js';\n\nexport interface FrameTargetProps extends BaseProps {\n $options: {\n mode: 'replace' | 'prepend' | 'append';\n id: string;\n leaveKeep: true;\n };\n}\n\n/**\n * FrameTarget class.\n */\nexport class FrameTarget<T extends BaseProps = BaseProps> extends Transition<T & FrameTargetProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...Transition.config,\n name: 'FrameTarget',\n log: true,\n options: {\n ...Transition.config.options,\n mode: {\n type: String,\n default: 'replace', // or 'prepend' or 'append'\n },\n id: String,\n },\n };\n\n /**\n * Insert modes.\n */\n static __INSERT_MODES = {\n prepend: 'afterbegin',\n append: 'beforeend',\n } as const;\n\n /**\n * Override options.\n */\n // @ts-ignore\n get $options() {\n const options = super.$options;\n\n options.leaveKeep = true;\n\n return options;\n }\n\n /**\n * Get uniq ID.\n */\n get id(): string {\n return this.$options.id ?? this.$el.id;\n }\n\n /**\n * Enter transition.\n */\n async enter() {\n this.$log('enter');\n\n const { enterFrom: from, enterActive: active, enterTo: to, leaveTo, enterKeep } = this.$options;\n const transitionStyles = { from, active, to };\n\n switch (this.$options.mode) {\n case 'append':\n case 'prepend':\n await Promise.all(\n Array.from(this.$el.children)\n .filter((child) =>\n from.split(' ').every((className) => child.classList.contains(className)),\n )\n .map((child) =>\n transition(child as HTMLElement, transitionStyles, enterKeep ? 'keep' : undefined),\n ),\n );\n break;\n case 'replace':\n default:\n transitionStyles.from = Array.from(new Set([from, leaveTo].flat())).join(' ');\n await transition(this.$el, transitionStyles, enterKeep ? 'keep' : undefined);\n }\n }\n\n /**\n * Update the content from the new target.\n * @param {FrameTarget} newTarget The instance of the new target.\n * @returns {void}\n */\n updateContent(newTarget: FrameTarget) {\n // @todo manage 'prepend' and 'append' transition\n // only the new content should have the transition\n // - add the leaveTo and enterFrom classes to all `newTarget.children`\n // - or wrap the new content in a custom div ?\n switch (this.$options.mode) {\n case 'prepend':\n case 'append':\n addClass(Array.from(newTarget.$el.children), this.$options.enterFrom.split(' '));\n this.$el.insertAdjacentHTML(\n FrameTarget.__INSERT_MODES[this.$options.mode],\n newTarget.$el.innerHTML,\n );\n break;\n case 'replace':\n default:\n this.$el.innerHTML = newTarget.$el.innerHTML;\n break;\n }\n }\n}\n"],
5
- "mappings": "AACA,SAAS,UAAU,kBAAkB;AACrC,SAAS,kBAAkB;AAapB,MAAM,oBAAqD,WAAiC;AAAA;AAAA;AAAA;AAAA,EAIjG,OAAO,SAAqB;AAAA,IAC1B,GAAG,WAAW;AAAA,IACd,MAAM;AAAA,IACN,KAAK;AAAA,IACL,SAAS;AAAA,MACP,GAAG,WAAW,OAAO;AAAA,MACrB,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS;AAAA;AAAA,MACX;AAAA,MACA,IAAI;AAAA,IACN;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAiB;AAAA,IACtB,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,WAAW;AACb,UAAM,UAAU,MAAM;AAEtB,YAAQ,YAAY;AAEpB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAAa;AACf,WAAO,KAAK,SAAS,MAAM,KAAK,IAAI;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAQ;AACZ,SAAK,KAAK,OAAO;AAEjB,UAAM,EAAE,WAAW,MAAM,aAAa,QAAQ,SAAS,IAAI,SAAS,UAAU,IAAI,KAAK;AACvF,UAAM,mBAAmB,EAAE,MAAM,QAAQ,GAAG;AAE5C,YAAQ,KAAK,SAAS,MAAM;AAAA,MAC1B,KAAK;AAAA,MACL,KAAK;AACH,cAAM,QAAQ;AAAA,UACZ,MAAM,KAAK,KAAK,IAAI,QAAQ,EACzB;AAAA,YAAO,CAAC,UACP,KAAK,MAAM,GAAG,EAAE,MAAM,CAAC,cAAc,MAAM,UAAU,SAAS,SAAS,CAAC;AAAA,UAC1E,EACC;AAAA,YAAI,CAAC,UACJ,WAAW,OAAsB,kBAAkB,YAAY,SAAS,MAAS;AAAA,UACnF;AAAA,QACJ;AACA;AAAA,MACF,KAAK;AAAA,MACL;AACE,yBAAiB,OAAO,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,OAAO,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG;AAC5E,cAAM,WAAW,KAAK,KAAK,kBAAkB,YAAY,SAAS,MAAS;AAAA,IAC/E;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAc,WAAwB;AAKpC,YAAQ,KAAK,SAAS,MAAM;AAAA,MAC1B,KAAK;AAAA,MACL,KAAK;AACH,iBAAS,MAAM,KAAK,UAAU,IAAI,QAAQ,GAAG,KAAK,SAAS,UAAU,MAAM,GAAG,CAAC;AAC/E,aAAK,IAAI;AAAA,UACP,YAAY,eAAe,KAAK,SAAS,IAAI;AAAA,UAC7C,UAAU,IAAI;AAAA,QAChB;AACA;AAAA,MACF,KAAK;AAAA,MACL;AACE,aAAK,IAAI,YAAY,UAAU,IAAI;AACnC;AAAA,IACJ;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { Transition } from '../Transition/index.js';\nimport morphdom from 'morphdom';\n\nexport interface FrameTargetProps extends BaseProps {\n $options: {\n mode: 'replace' | 'prepend' | 'append';\n };\n}\n\n/**\n * FrameTarget class.\n */\nexport class FrameTarget<T extends BaseProps = BaseProps> extends Transition<T & FrameTargetProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'FrameTarget',\n options: {\n mode: {\n type: String,\n default: 'replace', // or 'prepend' or 'append'\n },\n },\n };\n\n /**\n * Different mode of content insertion.\n */\n modes = {\n APPEND: 'append',\n PREPEND: 'prepend',\n REPLACE: 'replace',\n } as const;\n\n /**\n * Get uniq ID.\n */\n get id(): string {\n return this.$el.id;\n }\n\n /**\n * Update the content from the new target.\n */\n async updateContent(content: Element = null) {\n if (!content) {\n return;\n }\n\n const { mode } = this.$options;\n\n // In append or prepend mode, the leave transition can be used to\n // move the exisiting children of the root element, with the leave\n // transition being applied in parallel of the enter transition.\n if (mode === this.modes.APPEND || mode === this.modes.PREPEND) {\n const leaveTargets = Array.from(this.$el.children) as HTMLElement[];\n const enterTargets = Array.from(content.children) as HTMLElement[];\n\n this.$el[mode](...Array.from(content.childNodes));\n\n await Promise.all([\n this.leave(leaveTargets),\n this.enter(enterTargets),\n ]);\n } else {\n await this.leave();\n morphdom(this.$el, content);\n await this.enter();\n }\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,kBAAkB;AAC3B,OAAO,cAAc;AAWd,MAAM,oBAAqD,WAAiC;AAAA;AAAA;AAAA;AAAA,EAIjG,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS;AAAA;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,KAAa;AACf,WAAO,KAAK,IAAI;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,cAAc,UAAmB,MAAM;AAC3C,QAAI,CAAC,SAAS;AACZ;AAAA,IACF;AAEA,UAAM,EAAE,KAAK,IAAI,KAAK;AAKtB,QAAI,SAAS,KAAK,MAAM,UAAU,SAAS,KAAK,MAAM,SAAS;AAC7D,YAAM,eAAe,MAAM,KAAK,KAAK,IAAI,QAAQ;AACjD,YAAM,eAAe,MAAM,KAAK,QAAQ,QAAQ;AAEhD,WAAK,IAAI,IAAI,EAAE,GAAG,MAAM,KAAK,QAAQ,UAAU,CAAC;AAEhD,YAAM,QAAQ,IAAI;AAAA,QAChB,KAAK,MAAM,YAAY;AAAA,QACvB,KAAK,MAAM,YAAY;AAAA,MACzB,CAAC;AAAA,IACH,OAAO;AACL,YAAM,KAAK,MAAM;AACjB,eAAS,KAAK,KAAK,OAAO;AAC1B,YAAM,KAAK,MAAM;AAAA,IACnB;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,13 @@
1
+ import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
2
+ import { FrameLoader } from './FrameLoader.js';
3
+ import type { FrameLoaderProps } from './FrameLoader.js';
4
+ export type FrameTriggerLoaderProps = FrameLoaderProps;
5
+ /**
6
+ * FrameTriggerLoader class.
7
+ */
8
+ export declare class FrameTriggerLoader<T extends BaseProps = BaseProps> extends FrameLoader<T & FrameTriggerLoaderProps> {
9
+ /**
10
+ * Config.
11
+ */
12
+ static config: BaseConfig;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { FrameLoader } from "./FrameLoader.js";
2
+ class FrameTriggerLoader extends FrameLoader {
3
+ /**
4
+ * Config.
5
+ */
6
+ static config = {
7
+ name: "FrameTriggerLoader"
8
+ };
9
+ }
10
+ export {
11
+ FrameTriggerLoader
12
+ };
13
+ //# sourceMappingURL=FrameTriggerLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/ui/Frame/FrameTriggerLoader.ts"],
4
+ "sourcesContent": ["import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { FrameLoader } from './FrameLoader.js';\nimport type { FrameLoaderProps } from './FrameLoader.js';\n\nexport type FrameTriggerLoaderProps = FrameLoaderProps;\n\n/**\n * FrameTriggerLoader class.\n */\nexport class FrameTriggerLoader<T extends BaseProps = BaseProps> extends FrameLoader<\n T & FrameTriggerLoaderProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'FrameTriggerLoader',\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,mBAAmB;AAQrB,MAAM,2BAA4D,YAEvE;AAAA;AAAA;AAAA;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,EACR;AACF;",
6
+ "names": []
7
+ }
package/Frame/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  export * from './Frame.js';
2
2
  export * from './FrameAnchor.js';
3
3
  export * from './FrameForm.js';
4
+ export * from './FrameLoader.js';
5
+ export * from './FrameTriggerLoader.js';
4
6
  export * from './FrameTarget.js';
7
+ export * from './AbstractFrameTrigger.js';
8
+ export * from './types.js';
package/Frame/index.js CHANGED
@@ -1,5 +1,9 @@
1
1
  export * from "./Frame.js";
2
2
  export * from "./FrameAnchor.js";
3
3
  export * from "./FrameForm.js";
4
+ export * from "./FrameLoader.js";
5
+ export * from "./FrameTriggerLoader.js";
4
6
  export * from "./FrameTarget.js";
7
+ export * from "./AbstractFrameTrigger.js";
8
+ export * from "./types.js";
5
9
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/ui/Frame/index.ts"],
4
- "sourcesContent": ["export * from './Frame.js';\nexport * from './FrameAnchor.js';\nexport * from './FrameForm.js';\nexport * from './FrameTarget.js';\n"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["export * from './Frame.js';\nexport * from './FrameAnchor.js';\nexport * from './FrameForm.js';\nexport * from './FrameLoader.js';\nexport * from './FrameTriggerLoader.js';\nexport * from './FrameTarget.js';\nexport * from './AbstractFrameTrigger.js';\nexport * from './types.js';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,12 @@
1
+ import type { FrameAnchor } from './FrameAnchor.js';
2
+ import type { FrameForm } from './FrameForm.js';
3
+ export type FrameRequestInit = RequestInit & {
4
+ trigger?: FrameAnchor | FrameForm;
5
+ };
6
+ export type FrameTriggerEvent = CustomEvent<[URL, FrameRequestInit]>;
7
+ export type FrameFetchEvent = CustomEvent<[URL, FrameRequestInit]>;
8
+ export type FrameFetchBeforeEvent = FrameFetchEvent;
9
+ export type FrameFetchAfterEvent = CustomEvent<[URL, FrameRequestInit, string | Error]>;
10
+ export type FrameErrorEvent = CustomEvent<[URL, FrameRequestInit, Error]>;
11
+ export type FrameContentEvent = CustomEvent<[URL, FrameRequestInit, string]>;
12
+ export type FrameContentAfterEvent = CustomEvent<[URL, FrameRequestInit, string]>;
package/Frame/types.js ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,9 @@
1
+ export declare const EVENTS: {
2
+ FETCH_BEFORE: string;
3
+ FETCH: string;
4
+ FETCH_AFTER: string;
5
+ ERROR: string;
6
+ CONTENT: string;
7
+ CONTENT_AFTER: string;
8
+ TRIGGER: string;
9
+ };
package/Frame/utils.js ADDED
@@ -0,0 +1,13 @@
1
+ const EVENTS = {
2
+ FETCH_BEFORE: "frame-fetch-before",
3
+ FETCH: "frame-fetch",
4
+ FETCH_AFTER: "frame-fetch-after",
5
+ ERROR: "frame-error",
6
+ CONTENT: "frame-content",
7
+ CONTENT_AFTER: "frame-content-after",
8
+ TRIGGER: "frame-trigger"
9
+ };
10
+ export {
11
+ EVENTS
12
+ };
13
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../packages/ui/Frame/utils.ts"],
4
+ "sourcesContent": ["export const EVENTS = {\n FETCH_BEFORE: 'frame-fetch-before',\n FETCH: 'frame-fetch',\n FETCH_AFTER: 'frame-fetch-after',\n ERROR: 'frame-error',\n CONTENT: 'frame-content',\n CONTENT_AFTER: 'frame-content-after',\n TRIGGER: 'frame-trigger',\n};\n"],
5
+ "mappings": "AAAO,MAAM,SAAS;AAAA,EACpB,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,SAAS;AAAA,EACT,eAAe;AAAA,EACf,SAAS;AACX;",
6
+ "names": []
7
+ }
package/LICENSE.md ADDED
@@ -0,0 +1,110 @@
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2025 Studio Meta
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
@@ -3,7 +3,7 @@
3
3
  * @file
4
4
  * Reinsurance
5
5
  *
6
- * @param {Object} section_attr customize the section element.
6
+ * @param {Object} attr customize the section element.
7
7
  * @param {Object} title_attr customize the title element
8
8
  * @param {Object} content_attr customize the content element
9
9
  * @param {Boolean} slider_mobile activate scroll on mobile
@@ -16,7 +16,7 @@
16
16
  */
17
17
  #}
18
18
 
19
- {% set section_attributes = merge_html_attributes(section_attr ?? null, { class: 'text-[0] pt-14 pb-6 text-center w-full' }) %}
19
+ {% set attributes = merge_html_attributes(attr ?? null, { class: 'text-[0] pt-14 pb-6 text-center w-full' }) %}
20
20
 
21
21
  {% set title_attributes = merge_html_attributes(title_attr ?? null, { class: 'text-xl mb-2' }) %}
22
22
 
@@ -28,14 +28,14 @@
28
28
 
29
29
  {% if slider_mobile %}
30
30
  {% set mobile_classes = mobile_classes|default(['whitespace-nowrap overflow-scroll s:whitespace-normal s:overflow-auto']) %}
31
- {% set section_attributes = merge_html_attributes(
32
- section_attr ?? null,
31
+ {% set attributes = merge_html_attributes(
32
+ attr ?? null,
33
33
  {
34
- class: section_attributes.class|merge(mobile_classes)|join(' ')
34
+ class: attributes.class|merge(mobile_classes)|join(' ')
35
35
  }) %}
36
36
  {% endif %}
37
37
 
38
- <section {{ html_attributes(section_attributes) }}>
38
+ <section {{ html_attributes(attributes) }}>
39
39
  {% for item in list %}
40
40
  {% set icon_attributes = merge_html_attributes(icon_attr ?? null, { attr: { class: 'inline-block mb-2 s:mb-8' }, name: item.icon }) %}
41
41
  <div {{ html_attributes(item_attributes) }}>
@@ -1,13 +1,13 @@
1
1
  import { Base } from '@studiometa/js-toolkit';
2
- import type { BaseProps, BaseConfig, BaseInterface } from '@studiometa/js-toolkit';
3
- import { Slider } from './Slider.js';
2
+ import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
3
+ import type { Slider } from './Slider.js';
4
4
  export interface AbstractSliderChildProps extends BaseProps {
5
5
  $parent: Slider;
6
6
  }
7
7
  /**
8
8
  * AbstractSliderChild class.
9
9
  */
10
- export declare class AbstractSliderChild<T extends BaseProps = BaseProps> extends Base<T & AbstractSliderChildProps> implements BaseInterface {
10
+ export declare class AbstractSliderChild<T extends BaseProps = BaseProps> extends Base<T & AbstractSliderChildProps> {
11
11
  /**
12
12
  * Config.
13
13
  */
@@ -26,14 +26,10 @@ export declare class AbstractSliderChild<T extends BaseProps = BaseProps> extend
26
26
  destroyed(): void;
27
27
  /**
28
28
  * Dispatch event.
29
- * @param {CustomEvent} event
30
- * @returns {void}
31
29
  */
32
- handleEvent(event: any): void;
30
+ handleEvent(event: CustomEvent): void;
33
31
  /**
34
32
  * Update the child component with the given index.
35
- * @param {number} index The new active index.
36
- * @returns {void|(()=>void)}
37
33
  */
38
- update(index: any): void | (() => void);
34
+ update(index: number): void | (() => void);
39
35
  }