@studiometa/ui 0.2.42 → 0.2.44

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.
@@ -0,0 +1,90 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
23
+
24
+ // packages/ui/atoms/Action/Action.ts
25
+ var Action_exports = {};
26
+ __export(Action_exports, {
27
+ Action: () => Action
28
+ });
29
+ module.exports = __toCommonJS(Action_exports);
30
+ var import_js_toolkit = require("@studiometa/js-toolkit");
31
+ var import_utils = require("@studiometa/js-toolkit/utils");
32
+ var Action = class extends import_js_toolkit.Base {
33
+ /**
34
+ * Run method on targeted components
35
+ */
36
+ handleEvent() {
37
+ const { target: componentNames, method, selector } = this.$options;
38
+ let targets = componentNames.includes(" ") ? componentNames.split(" ").flatMap((componentName) => this.$root.$children?.[componentName]) : this.$root.$children?.[componentNames];
39
+ if (!targets || !targets.length) {
40
+ this.$warn("Target not found.");
41
+ return;
42
+ }
43
+ if (selector || selector.length > 0) {
44
+ targets = targets.filter((target) => target.$el.matches(selector));
45
+ }
46
+ if (!targets || !targets.length) {
47
+ this.$warn(`Target with selector "${selector}" not found.`);
48
+ return;
49
+ }
50
+ targets.forEach((target) => {
51
+ if (!(0, import_utils.isFunction)(target[method])) {
52
+ this.$warn(`Method "${method}()" not found on target.`, target);
53
+ return;
54
+ }
55
+ target[method]();
56
+ });
57
+ }
58
+ /**
59
+ * Mounted
60
+ */
61
+ mounted() {
62
+ const { on: eventName, target, method } = this.$options;
63
+ if (!target || !method || target.length <= 0 || method.length <= 0) {
64
+ this.$warn("No target or method specified.");
65
+ this.$terminate();
66
+ return;
67
+ }
68
+ this.$el.addEventListener(eventName, this);
69
+ }
70
+ /**
71
+ * Destroyed
72
+ */
73
+ destroyed() {
74
+ this.$el.removeEventListener(this.$options.on, this);
75
+ }
76
+ };
77
+ __publicField(Action, "config", {
78
+ name: "Action",
79
+ options: {
80
+ on: {
81
+ type: String,
82
+ default: "click"
83
+ },
84
+ target: String,
85
+ method: String,
86
+ selector: String
87
+ }
88
+ });
89
+ if (module.exports.default) module.exports = module.exports.default;
90
+ //# sourceMappingURL=Action.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/Action/Action.ts"],
4
+ "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport { isFunction } from '@studiometa/js-toolkit/utils';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\n\nexport interface ActionProps extends BaseProps {\n $options: {\n on: string;\n target: string;\n method: string;\n selector: string;\n };\n}\n\n/**\n * Action class.\n */\nexport class Action<T extends BaseProps = BaseProps> extends Base<ActionProps & T> {\n static config: BaseConfig = {\n name: 'Action',\n options: {\n on: {\n type: String,\n default: 'click',\n },\n target: String,\n method: String,\n selector: String,\n },\n };\n\n /**\n * Run method on targeted components\n */\n handleEvent() {\n const { target: componentNames, method, selector } = this.$options;\n\n let targets = componentNames.includes(' ')\n ? componentNames\n .split(' ')\n .flatMap((componentName) => this.$root.$children?.[componentName] as Base[])\n : (this.$root.$children?.[componentNames] as Base[]);\n\n if (!targets || !targets.length) {\n this.$warn('Target not found.');\n return;\n }\n\n if (selector || selector.length > 0) {\n targets = targets.filter((target) => target.$el.matches(selector));\n }\n\n if (!targets || !targets.length) {\n this.$warn(`Target with selector \"${selector}\" not found.`);\n return;\n }\n\n targets.forEach((target) => {\n if (!isFunction(target[method])) {\n this.$warn(`Method \"${method}()\" not found on target.`, target);\n return;\n }\n\n target[method]();\n });\n }\n\n /**\n * Mounted\n */\n mounted() {\n const { on: eventName, target, method } = this.$options;\n\n if (!target || !method || target.length <= 0 || method.length <= 0) {\n this.$warn('No target or method specified.');\n this.$terminate();\n return;\n }\n\n this.$el.addEventListener(eventName, this);\n }\n\n /**\n * Destroyed\n */\n destroyed() {\n this.$el.removeEventListener(this.$options.on, this);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqB;AACrB,mBAA2B;AAepB,IAAM,SAAN,cAAsD,uBAAsB;AAAA;AAAA;AAAA;AAAA,EAiBjF,cAAc;AACZ,UAAM,EAAE,QAAQ,gBAAgB,QAAQ,SAAS,IAAI,KAAK;AAE1D,QAAI,UAAU,eAAe,SAAS,GAAG,IACrC,eACG,MAAM,GAAG,EACT,QAAQ,CAAC,kBAAkB,KAAK,MAAM,YAAY,aAAa,CAAW,IAC5E,KAAK,MAAM,YAAY,cAAc;AAE1C,QAAI,CAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAK,MAAM,mBAAmB;AAC9B;AAAA,IACF;AAEA,QAAI,YAAY,SAAS,SAAS,GAAG;AACnC,gBAAU,QAAQ,OAAO,CAAC,WAAW,OAAO,IAAI,QAAQ,QAAQ,CAAC;AAAA,IACnE;AAEA,QAAI,CAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAK,MAAM,yBAAyB,sBAAsB;AAC1D;AAAA,IACF;AAEA,YAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAI,KAAC,yBAAW,OAAO,MAAM,CAAC,GAAG;AAC/B,aAAK,MAAM,WAAW,kCAAkC,MAAM;AAC9D;AAAA,MACF;AAEA,aAAO,MAAM,EAAE;AAAA,IACjB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,UAAM,EAAE,IAAI,WAAW,QAAQ,OAAO,IAAI,KAAK;AAE/C,QAAI,CAAC,UAAU,CAAC,UAAU,OAAO,UAAU,KAAK,OAAO,UAAU,GAAG;AAClE,WAAK,MAAM,gCAAgC;AAC3C,WAAK,WAAW;AAChB;AAAA,IACF;AAEA,SAAK,IAAI,iBAAiB,WAAW,IAAI;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACV,SAAK,IAAI,oBAAoB,KAAK,SAAS,IAAI,IAAI;AAAA,EACrD;AACF;AAtEE,cADW,QACJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,IACP,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,EACZ;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import { Base } from '@studiometa/js-toolkit';
2
+ import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
3
+ export interface ActionProps extends BaseProps {
4
+ $options: {
5
+ on: string;
6
+ target: string;
7
+ method: string;
8
+ selector: string;
9
+ };
10
+ }
11
+ /**
12
+ * Action class.
13
+ */
14
+ export declare class Action<T extends BaseProps = BaseProps> extends Base<ActionProps & T> {
15
+ static config: BaseConfig;
16
+ /**
17
+ * Run method on targeted components
18
+ */
19
+ handleEvent(): void;
20
+ /**
21
+ * Mounted
22
+ */
23
+ mounted(): void;
24
+ /**
25
+ * Destroyed
26
+ */
27
+ destroyed(): void;
28
+ }
@@ -0,0 +1,63 @@
1
+ import { Base } from "@studiometa/js-toolkit";
2
+ import { isFunction } from "@studiometa/js-toolkit/utils";
3
+ class Action extends Base {
4
+ static config = {
5
+ name: "Action",
6
+ options: {
7
+ on: {
8
+ type: String,
9
+ default: "click"
10
+ },
11
+ target: String,
12
+ method: String,
13
+ selector: String
14
+ }
15
+ };
16
+ /**
17
+ * Run method on targeted components
18
+ */
19
+ handleEvent() {
20
+ const { target: componentNames, method, selector } = this.$options;
21
+ let targets = componentNames.includes(" ") ? componentNames.split(" ").flatMap((componentName) => this.$root.$children?.[componentName]) : this.$root.$children?.[componentNames];
22
+ if (!targets || !targets.length) {
23
+ this.$warn("Target not found.");
24
+ return;
25
+ }
26
+ if (selector || selector.length > 0) {
27
+ targets = targets.filter((target) => target.$el.matches(selector));
28
+ }
29
+ if (!targets || !targets.length) {
30
+ this.$warn(`Target with selector "${selector}" not found.`);
31
+ return;
32
+ }
33
+ targets.forEach((target) => {
34
+ if (!isFunction(target[method])) {
35
+ this.$warn(`Method "${method}()" not found on target.`, target);
36
+ return;
37
+ }
38
+ target[method]();
39
+ });
40
+ }
41
+ /**
42
+ * Mounted
43
+ */
44
+ mounted() {
45
+ const { on: eventName, target, method } = this.$options;
46
+ if (!target || !method || target.length <= 0 || method.length <= 0) {
47
+ this.$warn("No target or method specified.");
48
+ this.$terminate();
49
+ return;
50
+ }
51
+ this.$el.addEventListener(eventName, this);
52
+ }
53
+ /**
54
+ * Destroyed
55
+ */
56
+ destroyed() {
57
+ this.$el.removeEventListener(this.$options.on, this);
58
+ }
59
+ }
60
+ export {
61
+ Action
62
+ };
63
+ //# sourceMappingURL=Action.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/Action/Action.ts"],
4
+ "sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport { isFunction } from '@studiometa/js-toolkit/utils';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\n\nexport interface ActionProps extends BaseProps {\n $options: {\n on: string;\n target: string;\n method: string;\n selector: string;\n };\n}\n\n/**\n * Action class.\n */\nexport class Action<T extends BaseProps = BaseProps> extends Base<ActionProps & T> {\n static config: BaseConfig = {\n name: 'Action',\n options: {\n on: {\n type: String,\n default: 'click',\n },\n target: String,\n method: String,\n selector: String,\n },\n };\n\n /**\n * Run method on targeted components\n */\n handleEvent() {\n const { target: componentNames, method, selector } = this.$options;\n\n let targets = componentNames.includes(' ')\n ? componentNames\n .split(' ')\n .flatMap((componentName) => this.$root.$children?.[componentName] as Base[])\n : (this.$root.$children?.[componentNames] as Base[]);\n\n if (!targets || !targets.length) {\n this.$warn('Target not found.');\n return;\n }\n\n if (selector || selector.length > 0) {\n targets = targets.filter((target) => target.$el.matches(selector));\n }\n\n if (!targets || !targets.length) {\n this.$warn(`Target with selector \"${selector}\" not found.`);\n return;\n }\n\n targets.forEach((target) => {\n if (!isFunction(target[method])) {\n this.$warn(`Method \"${method}()\" not found on target.`, target);\n return;\n }\n\n target[method]();\n });\n }\n\n /**\n * Mounted\n */\n mounted() {\n const { on: eventName, target, method } = this.$options;\n\n if (!target || !method || target.length <= 0 || method.length <= 0) {\n this.$warn('No target or method specified.');\n this.$terminate();\n return;\n }\n\n this.$el.addEventListener(eventName, this);\n }\n\n /**\n * Destroyed\n */\n destroyed() {\n this.$el.removeEventListener(this.$options.on, this);\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAepB,MAAM,eAAgD,KAAsB;AAAA,EACjF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,IAAI;AAAA,QACF,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,cAAc;AACZ,UAAM,EAAE,QAAQ,gBAAgB,QAAQ,SAAS,IAAI,KAAK;AAE1D,QAAI,UAAU,eAAe,SAAS,GAAG,IACrC,eACG,MAAM,GAAG,EACT,QAAQ,CAAC,kBAAkB,KAAK,MAAM,YAAY,aAAa,CAAW,IAC5E,KAAK,MAAM,YAAY,cAAc;AAE1C,QAAI,CAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAK,MAAM,mBAAmB;AAC9B;AAAA,IACF;AAEA,QAAI,YAAY,SAAS,SAAS,GAAG;AACnC,gBAAU,QAAQ,OAAO,CAAC,WAAW,OAAO,IAAI,QAAQ,QAAQ,CAAC;AAAA,IACnE;AAEA,QAAI,CAAC,WAAW,CAAC,QAAQ,QAAQ;AAC/B,WAAK,MAAM,yBAAyB,sBAAsB;AAC1D;AAAA,IACF;AAEA,YAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAI,CAAC,WAAW,OAAO,MAAM,CAAC,GAAG;AAC/B,aAAK,MAAM,WAAW,kCAAkC,MAAM;AAC9D;AAAA,MACF;AAEA,aAAO,MAAM,EAAE;AAAA,IACjB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,UAAM,EAAE,IAAI,WAAW,QAAQ,OAAO,IAAI,KAAK;AAE/C,QAAI,CAAC,UAAU,CAAC,UAAU,OAAO,UAAU,KAAK,OAAO,UAAU,GAAG;AAClE,WAAK,MAAM,gCAAgC;AAC3C,WAAK,WAAW;AAChB;AAAA,IACF;AAEA,SAAK,IAAI,iBAAiB,WAAW,IAAI;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACV,SAAK,IAAI,oBAAoB,KAAK,SAAS,IAAI,IAAI;AAAA,EACrD;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/ui/atoms/Action/index.ts
17
+ var Action_exports = {};
18
+ module.exports = __toCommonJS(Action_exports);
19
+ __reExport(Action_exports, require("./Action.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/Action/index.ts"],
4
+ "sourcesContent": ["export * from './Action.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,yBAAd;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './Action.js';
@@ -0,0 +1,2 @@
1
+ export * from "./Action.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/Action/index.ts"],
4
+ "sourcesContent": ["export * from './Action.js';\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,74 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
23
+
24
+ // packages/ui/atoms/CircularMarquee/CircularMarquee.ts
25
+ var CircularMarquee_exports = {};
26
+ __export(CircularMarquee_exports, {
27
+ CircularMarquee: () => CircularMarquee
28
+ });
29
+ module.exports = __toCommonJS(CircularMarquee_exports);
30
+ var import_js_toolkit = require("@studiometa/js-toolkit");
31
+ var import_utils = require("@studiometa/js-toolkit/utils");
32
+ var CircularMarquee = class extends import_js_toolkit.Base {
33
+ /**
34
+ * Rotate value.
35
+ * @type {number}
36
+ */
37
+ rotate = 0;
38
+ /**
39
+ * Scroll delta Y.
40
+ * @type {number}
41
+ */
42
+ deltaY = 0;
43
+ /**
44
+ * Transform values.
45
+ * @type {object}
46
+ */
47
+ transform = {
48
+ rotate: 0
49
+ };
50
+ scrolled(props) {
51
+ this.deltaY = props.delta.y;
52
+ }
53
+ ticked() {
54
+ this.rotate -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
55
+ this.transform.rotate = (0, import_utils.damp)(this.rotate, this.transform.rotate, 0.25);
56
+ return () => {
57
+ (0, import_utils.transform)(this.$el, this.transform);
58
+ };
59
+ }
60
+ };
61
+ /**
62
+ * CircularMarquee Configuration
63
+ */
64
+ __publicField(CircularMarquee, "config", {
65
+ name: "CircularMarquee",
66
+ options: {
67
+ sensitivity: {
68
+ type: Number,
69
+ default: 0.1
70
+ }
71
+ }
72
+ });
73
+ if (module.exports.default) module.exports = module.exports.default;
74
+ //# sourceMappingURL=CircularMarquee.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/CircularMarquee/CircularMarquee.ts"],
4
+ "sourcesContent": ["import { Base, BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { damp, transform } from '@studiometa/js-toolkit/utils';\n\nexport interface CircularMarqueeProps extends BaseProps {\n $options: {\n sensitivity: number;\n };\n}\n\n/**\n * CircularMarquee component\n */\nexport class CircularMarquee extends Base<CircularMarqueeProps> {\n /**\n * CircularMarquee Configuration\n */\n static config: BaseConfig = {\n name: 'CircularMarquee',\n options: {\n sensitivity: {\n type: Number,\n default: 0.1,\n },\n },\n };\n\n /**\n * Rotate value.\n * @type {number}\n */\n rotate = 0;\n\n /**\n * Scroll delta Y.\n * @type {number}\n */\n deltaY = 0;\n\n /**\n * Transform values.\n * @type {object}\n */\n transform = {\n rotate: 0,\n };\n\n scrolled(props) {\n this.deltaY = props.delta.y;\n }\n\n ticked() {\n this.rotate -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;\n\n this.transform.rotate = damp(this.rotate, this.transform.rotate, 0.25);\n\n return () => {\n transform(this.$el, this.transform);\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA4C;AAC5C,mBAAgC;AAWzB,IAAM,kBAAN,cAA8B,uBAA2B;AAAA;AAAA;AAAA;AAAA;AAAA,EAkB9D,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,YAAY;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,SAAS,OAAO;AACd,SAAK,SAAS,MAAM,MAAM;AAAA,EAC5B;AAAA,EAEA,SAAS;AACP,SAAK,WAAW,KAAK,IAAI,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS;AAE3D,SAAK,UAAU,aAAS,mBAAK,KAAK,QAAQ,KAAK,UAAU,QAAQ,IAAI;AAErE,WAAO,MAAM;AACX,kCAAU,KAAK,KAAK,KAAK,SAAS;AAAA,IACpC;AAAA,EACF;AACF;AAAA;AAAA;AAAA;AA3CE,cAJW,iBAIJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ import { Base, BaseConfig, BaseProps } from '@studiometa/js-toolkit';
2
+ export interface CircularMarqueeProps extends BaseProps {
3
+ $options: {
4
+ sensitivity: number;
5
+ };
6
+ }
7
+ /**
8
+ * CircularMarquee component
9
+ */
10
+ export declare class CircularMarquee extends Base<CircularMarqueeProps> {
11
+ /**
12
+ * CircularMarquee Configuration
13
+ */
14
+ static config: BaseConfig;
15
+ /**
16
+ * Rotate value.
17
+ * @type {number}
18
+ */
19
+ rotate: number;
20
+ /**
21
+ * Scroll delta Y.
22
+ * @type {number}
23
+ */
24
+ deltaY: number;
25
+ /**
26
+ * Transform values.
27
+ * @type {object}
28
+ */
29
+ transform: {
30
+ rotate: number;
31
+ };
32
+ scrolled(props: any): void;
33
+ ticked(): () => void;
34
+ }
@@ -0,0 +1,47 @@
1
+ import { Base } from "@studiometa/js-toolkit";
2
+ import { damp, transform } from "@studiometa/js-toolkit/utils";
3
+ class CircularMarquee extends Base {
4
+ /**
5
+ * CircularMarquee Configuration
6
+ */
7
+ static config = {
8
+ name: "CircularMarquee",
9
+ options: {
10
+ sensitivity: {
11
+ type: Number,
12
+ default: 0.1
13
+ }
14
+ }
15
+ };
16
+ /**
17
+ * Rotate value.
18
+ * @type {number}
19
+ */
20
+ rotate = 0;
21
+ /**
22
+ * Scroll delta Y.
23
+ * @type {number}
24
+ */
25
+ deltaY = 0;
26
+ /**
27
+ * Transform values.
28
+ * @type {object}
29
+ */
30
+ transform = {
31
+ rotate: 0
32
+ };
33
+ scrolled(props) {
34
+ this.deltaY = props.delta.y;
35
+ }
36
+ ticked() {
37
+ this.rotate -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;
38
+ this.transform.rotate = damp(this.rotate, this.transform.rotate, 0.25);
39
+ return () => {
40
+ transform(this.$el, this.transform);
41
+ };
42
+ }
43
+ }
44
+ export {
45
+ CircularMarquee
46
+ };
47
+ //# sourceMappingURL=CircularMarquee.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/CircularMarquee/CircularMarquee.ts"],
4
+ "sourcesContent": ["import { Base, BaseConfig, BaseProps } from '@studiometa/js-toolkit';\nimport { damp, transform } from '@studiometa/js-toolkit/utils';\n\nexport interface CircularMarqueeProps extends BaseProps {\n $options: {\n sensitivity: number;\n };\n}\n\n/**\n * CircularMarquee component\n */\nexport class CircularMarquee extends Base<CircularMarqueeProps> {\n /**\n * CircularMarquee Configuration\n */\n static config: BaseConfig = {\n name: 'CircularMarquee',\n options: {\n sensitivity: {\n type: Number,\n default: 0.1,\n },\n },\n };\n\n /**\n * Rotate value.\n * @type {number}\n */\n rotate = 0;\n\n /**\n * Scroll delta Y.\n * @type {number}\n */\n deltaY = 0;\n\n /**\n * Transform values.\n * @type {object}\n */\n transform = {\n rotate: 0,\n };\n\n scrolled(props) {\n this.deltaY = props.delta.y;\n }\n\n ticked() {\n this.rotate -= (Math.abs(this.deltaY) + 1) * this.$options.sensitivity;\n\n this.transform.rotate = damp(this.rotate, this.transform.rotate, 0.25);\n\n return () => {\n transform(this.$el, this.transform);\n };\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAmC;AAC5C,SAAS,MAAM,iBAAiB;AAWzB,MAAM,wBAAwB,KAA2B;AAAA;AAAA;AAAA;AAAA,EAI9D,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,aAAa;AAAA,QACX,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMT,YAAY;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EAEA,SAAS,OAAO;AACd,SAAK,SAAS,MAAM,MAAM;AAAA,EAC5B;AAAA,EAEA,SAAS;AACP,SAAK,WAAW,KAAK,IAAI,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS;AAE3D,SAAK,UAAU,SAAS,KAAK,KAAK,QAAQ,KAAK,UAAU,QAAQ,IAAI;AAErE,WAAO,MAAM;AACX,gBAAU,KAAK,KAAK,KAAK,SAAS;AAAA,IACpC;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,55 @@
1
+ {#
2
+ /**
3
+ * @file
4
+ * Circular Marquee
5
+ *
6
+ * @param {String} id - *required
7
+ * @param {Number} outer_radius
8
+ * @param {Number} radius
9
+ * @param {Number} cx
10
+ * @param {Number} cy
11
+ * @param {String} content
12
+ * @param {Object} content_attr
13
+ * @param {Number} sensitivity
14
+ */
15
+ #}
16
+
17
+ {# Outer radius is svg size radius #}
18
+ {% set outer_radius = outer_radius|default(250) %}
19
+ {% set outer_diameter = outer_radius * 2 %}
20
+
21
+ {# Inner radius is the circle size inside the svg (need to be smaller to not cut text with svg viewbox) #}
22
+ {% set radius = radius|default(220) %}
23
+ {% set diameter = radius * 2 %}
24
+ {% set cx = cx|default(radius) %}
25
+ {% set cy = cy|default(radius) %}
26
+ {% set perimeter = 3.1413 * diameter %}
27
+
28
+ {% set first = 'M ' ~ (outer_radius - cx) ~ ',' ~ outer_radius %}
29
+ {% set second = 'a ' ~ radius ~ ',' ~ radius ~ ' 0 1,1 ' ~ diameter ~ ',0' %}
30
+ {% set third = 'a ' ~ radius ~ ',' ~ radius ~ ' 0 1,1 -' ~ diameter ~ ',0' %}
31
+ {% set d = [first, second, third]|join(' ') %}
32
+
33
+ {% set default_content_attributes = { 'xlink:href': '#' ~ id } %}
34
+ {% set content_attributes =
35
+ merge_html_attributes(default_content_attributes, content_attr|default({}))
36
+ %}
37
+
38
+ <div data-component="CircularMarquee"
39
+ {{ html_attributes({ data_option_sensitivity: sensitivity }) }}>
40
+ <svg aria-hidden="true"
41
+ xmlns="http://www.w3.org/2000/svg"
42
+ viewBox="0 0 {{ outer_diameter }} {{ outer_diameter }}"
43
+ width="{{ outer_diameter }}"
44
+ height="{{ outer_diameter }}"
45
+ class="z-default relative left-1/2 -translate-x-1/2">
46
+ <defs>
47
+ <path d="{{ d }}" id="{{ id }}" />
48
+ </defs>
49
+ <text dy="0" textLength="{{ perimeter }}">
50
+ <textPath {{ html_attributes(content_attributes) }}>
51
+ {{ content|raw }}
52
+ </textPath>
53
+ </text>
54
+ </svg>
55
+ </div>
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/ui/atoms/CircularMarquee/index.ts
17
+ var CircularMarquee_exports = {};
18
+ module.exports = __toCommonJS(CircularMarquee_exports);
19
+ __reExport(CircularMarquee_exports, require("./CircularMarquee.cjs"), module.exports);
20
+ if (module.exports.default) module.exports = module.exports.default;
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/CircularMarquee/index.ts"],
4
+ "sourcesContent": ["export * from './CircularMarquee.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oCAAc,kCAAd;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './CircularMarquee.js';
@@ -0,0 +1,2 @@
1
+ export * from "./CircularMarquee.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/ui/atoms/CircularMarquee/index.ts"],
4
+ "sourcesContent": ["export * from './CircularMarquee.js';\n"],
5
+ "mappings": "AAAA,cAAc;",
6
+ "names": []
7
+ }
package/atoms/index.cjs CHANGED
@@ -16,7 +16,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  // packages/ui/atoms/index.ts
17
17
  var atoms_exports = {};
18
18
  module.exports = __toCommonJS(atoms_exports);
19
+ __reExport(atoms_exports, require("./Action/index.cjs"), module.exports);
19
20
  __reExport(atoms_exports, require("./AnchorScrollTo/index.cjs"), module.exports);
21
+ __reExport(atoms_exports, require("./CircularMarquee/index.cjs"), module.exports);
20
22
  __reExport(atoms_exports, require("./Cursor/index.cjs"), module.exports);
21
23
  __reExport(atoms_exports, require("./Figure/index.cjs"), module.exports);
22
24
  __reExport(atoms_exports, require("./LargeText/index.cjs"), module.exports);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/ui/atoms/index.ts"],
4
- "sourcesContent": ["export * from './AnchorScrollTo/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,uCAAd;AACA,0BAAc,+BADd;AAEA,0BAAc,+BAFd;AAGA,0BAAc,kCAHd;AAIA,0BAAc,oCAJd;AAKA,0BAAc,iCALd;AAMA,0BAAc,wCANd;AAOA,0BAAc,qCAPd;",
4
+ "sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;AACA,0BAAc,uCADd;AAEA,0BAAc,wCAFd;AAGA,0BAAc,+BAHd;AAIA,0BAAc,+BAJd;AAKA,0BAAc,kCALd;AAMA,0BAAc,oCANd;AAOA,0BAAc,iCAPd;AAQA,0BAAc,wCARd;AASA,0BAAc,qCATd;",
6
6
  "names": []
7
7
  }
package/atoms/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ export * from './Action/index.js';
1
2
  export * from './AnchorScrollTo/index.js';
3
+ export * from './CircularMarquee/index.js';
2
4
  export * from './Cursor/index.js';
3
5
  export * from './Figure/index.js';
4
6
  export * from './LargeText/index.js';
package/atoms/index.js CHANGED
@@ -1,4 +1,6 @@
1
+ export * from "./Action/index.js";
1
2
  export * from "./AnchorScrollTo/index.js";
3
+ export * from "./CircularMarquee/index.js";
2
4
  export * from "./Cursor/index.js";
3
5
  export * from "./Figure/index.js";
4
6
  export * from "./LargeText/index.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../packages/ui/atoms/index.ts"],
4
- "sourcesContent": ["export * from './AnchorScrollTo/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["export * from './Action/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Figure/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/ui",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "description": "A set of opiniated, unstyled and accessible components",
5
5
  "publishConfig": {
6
6
  "access": "public"