@wix/site-service-interactions 1.0.11 → 1.0.13

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 (76) hide show
  1. package/cjs/build/definition/index.d.ts +19 -3
  2. package/cjs/build/definition/index.js.map +1 -1
  3. package/cjs/build/implementations/InteractionsScriptElement.d.ts +1 -1
  4. package/cjs/build/implementations/configEntries.d.ts +13 -0
  5. package/cjs/build/implementations/configEntries.js +80 -0
  6. package/cjs/build/implementations/configEntries.js.map +1 -0
  7. package/cjs/build/implementations/coreInteractions.d.ts +2 -2
  8. package/cjs/build/implementations/coreInteractions.js +50 -23
  9. package/cjs/build/implementations/coreInteractions.js.map +1 -1
  10. package/cjs/build/implementations/interactionsService.d.ts +5 -4
  11. package/cjs/build/implementations/v2/InteractionsScriptElement.d.ts +2 -2
  12. package/cjs/build/implementations/v2/InteractionsScriptElement.js.map +1 -1
  13. package/cjs/build/implementations/v2/authoredStyles.d.ts +2 -0
  14. package/cjs/build/implementations/v2/authoredStyles.js +95 -0
  15. package/cjs/build/implementations/v2/authoredStyles.js.map +1 -0
  16. package/cjs/build/implementations/v2/cdnUrls.d.ts +2 -1
  17. package/cjs/build/implementations/v2/cdnUrls.js +3 -2
  18. package/cjs/build/implementations/v2/cdnUrls.js.map +1 -1
  19. package/cjs/build/implementations/v2/clickTriggerCss.d.ts +1 -1
  20. package/cjs/build/implementations/v2/configCss.d.ts +1 -1
  21. package/cjs/build/implementations/v2/configCss.js +3 -36
  22. package/cjs/build/implementations/v2/configCss.js.map +1 -1
  23. package/cjs/build/implementations/v2/configStyleHeadContent.js +8 -6
  24. package/cjs/build/implementations/v2/configStyleHeadContent.js.map +1 -1
  25. package/cjs/build/implementations/v2/interactionsScriptContent.js +18 -7
  26. package/cjs/build/implementations/v2/interactionsScriptContent.js.map +1 -1
  27. package/cjs/build/implementations/v2/motionPresets.d.ts +14 -0
  28. package/cjs/build/implementations/v2/motionPresets.js +76 -0
  29. package/cjs/build/implementations/v2/motionPresets.js.map +1 -0
  30. package/cjs/build/service.d.ts +1 -1
  31. package/cjs/build/types/index.d.ts +1 -1
  32. package/dist/definition/index.d.ts +19 -3
  33. package/dist/definition/index.js.map +1 -1
  34. package/dist/implementations/InteractionsScriptElement.d.ts +1 -1
  35. package/dist/implementations/configEntries.d.ts +13 -0
  36. package/dist/implementations/configEntries.js +73 -0
  37. package/dist/implementations/configEntries.js.map +1 -0
  38. package/dist/implementations/coreInteractions.d.ts +2 -2
  39. package/dist/implementations/coreInteractions.js +50 -23
  40. package/dist/implementations/coreInteractions.js.map +1 -1
  41. package/dist/implementations/interactionsService.d.ts +5 -4
  42. package/dist/implementations/v2/InteractionsScriptElement.d.ts +2 -2
  43. package/dist/implementations/v2/InteractionsScriptElement.js.map +1 -1
  44. package/dist/implementations/v2/authoredStyles.d.ts +2 -0
  45. package/dist/implementations/v2/authoredStyles.js +91 -0
  46. package/dist/implementations/v2/authoredStyles.js.map +1 -0
  47. package/dist/implementations/v2/cdnUrls.d.ts +2 -1
  48. package/dist/implementations/v2/cdnUrls.js +2 -1
  49. package/dist/implementations/v2/cdnUrls.js.map +1 -1
  50. package/dist/implementations/v2/clickTriggerCss.d.ts +1 -1
  51. package/dist/implementations/v2/configCss.d.ts +1 -1
  52. package/dist/implementations/v2/configCss.js +2 -2
  53. package/dist/implementations/v2/configCss.js.map +1 -1
  54. package/dist/implementations/v2/configStyleHeadContent.js +8 -6
  55. package/dist/implementations/v2/configStyleHeadContent.js.map +1 -1
  56. package/dist/implementations/v2/interactionsScriptContent.js +19 -8
  57. package/dist/implementations/v2/interactionsScriptContent.js.map +1 -1
  58. package/dist/implementations/v2/motionPresets.d.ts +14 -0
  59. package/dist/implementations/v2/motionPresets.js +39 -0
  60. package/dist/implementations/v2/motionPresets.js.map +1 -0
  61. package/dist/service.d.ts +1 -1
  62. package/dist/types/index.d.ts +1 -1
  63. package/package.json +6 -4
  64. package/src/definition/index.ts +19 -2
  65. package/src/implementations/InteractionsScriptElement.tsx +1 -1
  66. package/src/implementations/configEntries.ts +105 -0
  67. package/src/implementations/coreInteractions.ts +64 -30
  68. package/src/implementations/v2/InteractionsScriptElement.tsx +3 -3
  69. package/src/implementations/v2/authoredStyles.ts +108 -0
  70. package/src/implementations/v2/cdnUrls.ts +4 -1
  71. package/src/implementations/v2/clickTriggerCss.ts +1 -1
  72. package/src/implementations/v2/configCss.ts +4 -5
  73. package/src/implementations/v2/configStyleHeadContent.ts +9 -6
  74. package/src/implementations/v2/interactionsScriptContent.ts +20 -8
  75. package/src/implementations/v2/motionPresets.ts +60 -0
  76. package/src/types/index.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interactionsScriptContent.js","sourceRoot":"","sources":["../../../../src/implementations/v2/interactionsScriptContent.ts"],"names":[],"mappings":";;;AAAA,uCAAiF;AAEjF;;;;;GAKG;AACI,MAAM,6BAA6B,GAAG,GAAW,EAAE,CACtD,mCAAmC,gCAAsB,qCAAqC,uCAA6B,IAAI,CAAA;AADtH,QAAA,6BAA6B,iCACyF;AAE5H,MAAM,8BAA8B,GAAG,CAAC,QAAgB,EAAE,eAAwB,EAAU,EAAE,CACjG;IACI,mDAAmD,QAAQ,KAAK;IAChE,sBAAsB;IACtB,wDAAwD;IACxD,uDAAuD;IACvD,gBAAgB,gCAAsB,MAAM;IAC5C,gBAAgB,uCAA6B,MAAM;IACnD,MAAM;IACN,qCAAqC;IACrC,mCAAmC,eAAe,EAAE;IACpD,oBAAoB;IACpB,wCAAwC;IACxC,mDAAmD;IACnD,QAAQ;IACR,8BAA8B;IAC9B,kBAAkB;IAClB,+BAA+B;IAC/B,QAAQ;IACR,MAAM;IACN,2BAA2B;IAC3B,GAAG;CACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAtBH,QAAA,8BAA8B,kCAsB3B"}
1
+ {"version":3,"file":"interactionsScriptContent.js","sourceRoot":"","sources":["../../../../src/implementations/v2/interactionsScriptContent.ts"],"names":[],"mappings":";;;AAAA,uCAAmH;AACnH,mDAA+C;AAE/C,2DAA2D;AAC3D,MAAM,kBAAkB,GAAG,CAAC,gCAAsB,EAAE,8CAAoC,EAAE,mCAAyB,CAAC,CAAA;AAEpH;;;;;GAKG;AACI,MAAM,6BAA6B,GAAG,GAAW,EAAE,CACtD,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AADzE,QAAA,6BAA6B,iCAC4C;AAE/E,MAAM,8BAA8B,GAAG,CAAC,QAAgB,EAAE,eAAwB,EAAU,EAAE,CACjG;IACI,mDAAmD,QAAQ,KAAK;IAChE,sBAAsB;IACtB,8DAA8D;IAC9D,+EAA+E;IAC/E,sEAAsE;IACtE,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,GAAG,MAAM,CAAC;IAC3D,MAAM;IACN,0FAA0F;IAC1F,4EAA4E;IAC5E,mCAAmC;IACnC,oDAAoD;IACpD,8BAA8B,6BAAa,kCAAkC;IAC7E,KAAK;IACL,qEAAqE;IACrE,mCAAmC,eAAe,EAAE;IACpD,oBAAoB;IACpB,wCAAwC;IACxC,mDAAmD;IACnD,QAAQ;IACR,8BAA8B;IAC9B,kBAAkB;IAClB,+BAA+B;IAC/B,QAAQ;IACR,MAAM;IACN,mCAAmC;IACnC,6BAA6B;IAC7B,KAAK;IACL,GAAG;CACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AA9BH,QAAA,8BAA8B,kCA8B3B"}
@@ -0,0 +1,14 @@
1
+ import type { InteractConfig } from '@wix/interact-v2';
2
+ type EffectModule = {
3
+ web: unknown;
4
+ style?: unknown;
5
+ getNames: unknown;
6
+ };
7
+ export declare const LEGACY_PREFIX = "LEGACY_";
8
+ /**
9
+ * Both preset packages under one registry, mirroring what the client loader registers. The legacy
10
+ * names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
11
+ */
12
+ export declare const motionPresets: Record<string, EffectModule>;
13
+ export declare const aliasLegacyNamedEffects: (interact: InteractConfig) => InteractConfig;
14
+ export {};
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.aliasLegacyNamedEffects = exports.motionPresets = exports.LEGACY_PREFIX = void 0;
37
+ const allLegacyPresets = __importStar(require("@wix/wix-motion-presets"));
38
+ const allPresets = __importStar(require("@wix/motion-presets"));
39
+ exports.LEGACY_PREFIX = 'LEGACY_';
40
+ const isEffectModule = (value) => typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value;
41
+ const getPresetModules = (namespace, prefix = '') => Object.fromEntries(Object.entries(namespace)
42
+ .filter(([, value]) => isEffectModule(value))
43
+ .map(([name, value]) => [`${prefix}${name}`, value]));
44
+ /**
45
+ * Both preset packages under one registry, mirroring what the client loader registers. The legacy
46
+ * names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
47
+ */
48
+ exports.motionPresets = {
49
+ ...getPresetModules(allPresets),
50
+ ...getPresetModules(allLegacyPresets, exports.LEGACY_PREFIX),
51
+ };
52
+ const aliasEffect = (effect) => {
53
+ const { namedEffect } = effect;
54
+ if (!namedEffect?.type) {
55
+ return effect;
56
+ }
57
+ return { ...effect, namedEffect: { ...namedEffect, type: `${exports.LEGACY_PREFIX}${namedEffect.type}` } };
58
+ };
59
+ const aliasSequence = (sequence) => {
60
+ const { effects } = sequence;
61
+ return effects ? { ...sequence, effects: effects.map(aliasEffect) } : sequence;
62
+ };
63
+ const mapRecord = (record, map) => Object.fromEntries(Object.entries(record).map(([key, value]) => [key, map(value)]));
64
+ // TODO(ameerf): make this implementation simpler without so many copies of the config object. The current implementation is a direct translation of the v1 code, which was written to avoid mutating the config object.
65
+ const aliasLegacyNamedEffects = (interact) => ({
66
+ ...interact,
67
+ ...(interact.effects && { effects: mapRecord(interact.effects, aliasEffect) }),
68
+ ...(interact.sequences && { sequences: mapRecord(interact.sequences, aliasSequence) }),
69
+ interactions: interact.interactions.map(interaction => ({
70
+ ...interaction,
71
+ ...(interaction.effects && { effects: interaction.effects.map(aliasEffect) }),
72
+ ...(interaction.sequences && { sequences: interaction.sequences.map(aliasSequence) }),
73
+ })),
74
+ });
75
+ exports.aliasLegacyNamedEffects = aliasLegacyNamedEffects;
76
+ //# sourceMappingURL=motionPresets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motionPresets.js","sourceRoot":"","sources":["../../../../src/implementations/v2/motionPresets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA2D;AAC3D,gEAAiD;AAWpC,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E,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAA;AAClF,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAI,MAAyB,EAAE,GAAoB,EAAqB,EAAE,CACxF,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvF,wNAAwN;AACjN,MAAM,uBAAuB,GAAG,CAAC,QAAwB,EAAkB,EAAE,CAAC,CAAC;IAClF,GAAG,QAAQ;IACX,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC;IAC9E,GAAG,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC;IACtF,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACpD,GAAG,WAAW;QACd,GAAG,CAAC,WAAW,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7E,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;KACxF,CAAC,CAAC;CACN,CAAC,CAAA;AATW,QAAA,uBAAuB,2BASlC"}
@@ -1,7 +1,7 @@
1
1
  import { InteractionsService } from './implementations/interactionsService';
2
2
  export declare const definition: string & {
3
3
  __api: import("./definition").IInteractionsService;
4
- __config: import("@wix/interact").InteractConfig;
4
+ __config: import("./definition").IInteractionsServiceConfig;
5
5
  isServiceDefinition?: boolean;
6
6
  } & import("./definition").IInteractionsService;
7
7
  export default InteractionsService;
@@ -1,2 +1,2 @@
1
1
  export type { IInteractionsService, IInteractionsServiceConfig, IInteractionsDefinition } from '../definition';
2
- export type { InteractConfig } from '@wix/interact';
2
+ export type { InteractConfig } from '@wix/interact-v2';
@@ -1,12 +1,28 @@
1
1
  import type { StaticServiceDefinition } from '@wix/static-service';
2
- import type { InteractConfig } from '@wix/interact';
3
- export type IInteractionsServiceConfig = InteractConfig;
2
+ import type { InteractConfig } from '@wix/interact-v2';
3
+ export type { InteractConfig };
4
+ export type InteractStyleRule = {
5
+ key?: string;
6
+ selector?: string;
7
+ '@media'?: string;
8
+ '@container'?: string;
9
+ '@supports'?: string;
10
+ properties: Record<string, string>;
11
+ };
12
+ export type InteractConfigEntry = {
13
+ namespace?: string;
14
+ interact: InteractConfig;
15
+ styles?: InteractStyleRule[];
16
+ };
17
+ export type IInteractionsServiceConfig = InteractConfig | {
18
+ entries: InteractConfigEntry[];
19
+ };
4
20
  export interface IInteractionsService {
5
21
  hasInteractions: (path: string) => boolean;
6
22
  }
7
23
  export type IInteractionsDefinition = StaticServiceDefinition<IInteractionsService, IInteractionsServiceConfig>;
8
24
  export declare const InteractionsDefinition: string & {
9
25
  __api: IInteractionsService;
10
- __config: InteractConfig;
26
+ __config: IInteractionsServiceConfig;
11
27
  isServiceDefinition?: boolean;
12
28
  } & IInteractionsService;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAYzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACrD,gCAAgC,CACnC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AA6BzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACrD,gCAAgC,CACnC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import type { FunctionComponent } from 'react';
2
- import type { InteractConfig } from '@wix/interact';
2
+ import type { InteractConfig } from '@wix/interact-v2';
3
3
  export declare const createInteractionsScriptElement: (config: InteractConfig, isReducedMotion: boolean, pageId: string) => FunctionComponent;
@@ -0,0 +1,13 @@
1
+ import type { InteractConfigEntry, IInteractionsServiceConfig } from '../definition';
2
+ export declare const REACTIONS_NAMESPACE = "reactions";
3
+ export declare const getInteractConfigEntries: (config: IInteractionsServiceConfig) => InteractConfigEntry[];
4
+ export declare const getResolvedConfigEntries: (config: IInteractionsServiceConfig) => InteractConfigEntry[];
5
+ export declare const getInteractiveKeys: ({ interact }: InteractConfigEntry) => Set<string>;
6
+ /**
7
+ * Interact resolves a custom-element key to the first instance containing that key, so a key shared
8
+ * by two entries would silently drop one of them. Experience entries own the keys they declare:
9
+ * whatever they claim is stripped from the reactions entry by dropping whole interactions whose
10
+ * resolved keys overlap. Top-level effect and sequence libraries are left intact. A collision between two
11
+ * experience entries stays an error, since neither of them is authoritative.
12
+ */
13
+ export declare const resolveInteractKeyConflicts: (entries: InteractConfigEntry[]) => InteractConfigEntry[];
@@ -0,0 +1,73 @@
1
+ import { aliasLegacyNamedEffects } from './v2/motionPresets';
2
+ export const REACTIONS_NAMESPACE = 'reactions';
3
+ export const getInteractConfigEntries = (config) => 'entries' in config ? config.entries : [{ interact: config, namespace: REACTIONS_NAMESPACE }];
4
+ export const getResolvedConfigEntries = (config) => getInteractConfigEntries(config).map(entry => entry.namespace === REACTIONS_NAMESPACE
5
+ ? { ...entry, interact: aliasLegacyNamedEffects(entry.interact) }
6
+ : entry);
7
+ /** An `effectId` points at `interact.effects`, which is where a reactions effect keeps its key. */
8
+ const resolveEffectKey = (interact, effect) => effect.key ?? (effect.effectId ? interact.effects?.[effect.effectId]?.key : undefined);
9
+ const addEffectKeys = (keys, interact, effects = []) => {
10
+ for (const effect of effects) {
11
+ const key = resolveEffectKey(interact, effect);
12
+ if (key) {
13
+ keys.add(key);
14
+ }
15
+ }
16
+ };
17
+ /** A `sequenceId` reference has no inline effects; resolve it against `interact.sequences`. */
18
+ const getSequenceEffects = (interact, sequence) => 'effects' in sequence ? sequence.effects : (interact.sequences?.[sequence.sequenceId]?.effects ?? []);
19
+ const getInteractionKeys = (interact, interaction) => {
20
+ const keys = new Set([interaction.key]);
21
+ addEffectKeys(keys, interact, interaction.effects);
22
+ for (const sequence of interaction.sequences ?? []) {
23
+ addEffectKeys(keys, interact, getSequenceEffects(interact, sequence));
24
+ }
25
+ return keys;
26
+ };
27
+ export const getInteractiveKeys = ({ interact }) => {
28
+ const keys = new Set();
29
+ for (const interaction of interact.interactions) {
30
+ getInteractionKeys(interact, interaction).forEach(key => keys.add(key));
31
+ }
32
+ return keys;
33
+ };
34
+ const dropOverriddenKeys = (entry, overriddenKeys) => {
35
+ const { interact } = entry;
36
+ return {
37
+ ...entry,
38
+ interact: {
39
+ ...interact,
40
+ interactions: interact.interactions.filter(interaction => ![...getInteractionKeys(interact, interaction)].some(key => overriddenKeys.has(key))),
41
+ },
42
+ };
43
+ };
44
+ /**
45
+ * Interact resolves a custom-element key to the first instance containing that key, so a key shared
46
+ * by two entries would silently drop one of them. Experience entries own the keys they declare:
47
+ * whatever they claim is stripped from the reactions entry by dropping whole interactions whose
48
+ * resolved keys overlap. Top-level effect and sequence libraries are left intact. A collision between two
49
+ * experience entries stays an error, since neither of them is authoritative.
50
+ */
51
+ export const resolveInteractKeyConflicts = (entries) => {
52
+ const owners = new Map();
53
+ entries.forEach((entry, index) => {
54
+ if (entry.namespace === REACTIONS_NAMESPACE) {
55
+ return;
56
+ }
57
+ const owner = entry.namespace ?? `entry-${index}`;
58
+ for (const key of getInteractiveKeys(entry)) {
59
+ const existingOwner = owners.get(key);
60
+ if (existingOwner !== undefined) {
61
+ throw new Error(`Interactions config key "${key}" is shared by "${existingOwner}" and "${owner}". ` +
62
+ 'Keys must be unique across config entries.');
63
+ }
64
+ owners.set(key, owner);
65
+ }
66
+ });
67
+ if (!owners.size) {
68
+ return entries;
69
+ }
70
+ const overriddenKeys = new Set(owners.keys());
71
+ return entries.map(entry => entry.namespace === REACTIONS_NAMESPACE ? dropOverriddenKeys(entry, overriddenKeys) : entry);
72
+ };
73
+ //# sourceMappingURL=configEntries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configEntries.js","sourceRoot":"","sources":["../../src/implementations/configEntries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAA;AAM9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAkC,EAAyB,EAAE,CAClG,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAA;AAEjG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAkC,EAAyB,EAAE,CAClG,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CACzC,KAAK,CAAC,SAAS,KAAK,mBAAmB;IACnC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;IACjE,CAAC,CAAC,KAAK,CACd,CAAA;AAEL,mGAAmG;AACnG,MAAM,gBAAgB,GAAG,CAAC,QAAwB,EAAE,MAAmB,EAAsB,EAAE,CAC3F,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GA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mBAAmB,aAAa,UAAU,KAAK,KAAK;oBAC/E,4CAA4C,CACnD,CAAA;YACL,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1B,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,OAAO,CAAA;IAClB,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CACvB,KAAK,CAAC,SAAS,KAAK,mBAAmB,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAC9F,CAAA;AACL,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
- import type { InteractConfig } from '@wix/interact';
2
1
  import type { ServicesManager } from '@wix/services-manager/types';
3
- export declare const coreInteractions: (config: InteractConfig, getService: ServicesManager["getService"]) => {
2
+ import type { IInteractionsServiceConfig } from '../definition';
3
+ export declare const coreInteractions: (config: IInteractionsServiceConfig, getService: ServicesManager["getService"]) => {
4
4
  interactiveComps: Set<string>;
5
5
  };
@@ -14,7 +14,11 @@ import { createV2InteractionsScriptElement } from './v2/InteractionsScriptElemen
14
14
  import { getV2ConfigCss } from './v2/configCss';
15
15
  import { getV2ConfigStyleHeadContent } from './v2/configStyleHeadContent';
16
16
  import { getV2ModulePreloadHeadContent } from './v2/interactionsScriptContent';
17
- const initInteract = (config, isReducedMotion) => {
17
+ import { getAuthoredStylesCss } from './v2/authoredStyles';
18
+ import { getInteractConfigEntries, getInteractiveKeys, getResolvedConfigEntries, resolveInteractKeyConflicts, } from './configEntries';
19
+ /** An entry without interactions contributes CSS only; nothing has to load Interact for it. */
20
+ const getRuntimeConfigs = (entries) => entries.map(({ interact }) => interact).filter(({ interactions }) => interactions.length > 0);
21
+ const initInteract = (entries, isReducedMotion) => {
18
22
  // Bundled runtime is v1. v2 on the client is the CDN loader.
19
23
  Interact.forceReducedMotion = isReducedMotion;
20
24
  Interact.setup({
@@ -24,10 +28,22 @@ const initInteract = (config, isReducedMotion) => {
24
28
  useSafeViewEnter: true,
25
29
  },
26
30
  });
27
- Interact.create(config);
31
+ for (const { interact } of entries) {
32
+ Interact.create(interact);
33
+ }
34
+ };
35
+ const getV2HeadContent = (entries) => {
36
+ const generatedCss = entries
37
+ .map(({ interact }) => getV2ConfigCss(interact).trim())
38
+ .filter(Boolean)
39
+ .join('\n');
40
+ const css = [getAuthoredStylesCss(entries).trim(), generatedCss].filter(Boolean).join('\n');
41
+ return ((getRuntimeConfigs(entries).length ? getV2ModulePreloadHeadContent() : '') +
42
+ (css ? getV2ConfigStyleHeadContent(css) : ''));
28
43
  };
29
- const initRuntime = (config, isReducedMotion, getService, useV2) => {
30
- if (!config.interactions?.length) {
44
+ const initRuntime = (entries, isReducedMotion, getService, useV2) => {
45
+ const runtimeConfigs = getRuntimeConfigs(entries);
46
+ if (!runtimeConfigs.length) {
31
47
  return;
32
48
  }
33
49
  const pageId = getService(PagesDefinition).currentPageId();
@@ -35,47 +51,58 @@ const initRuntime = (config, isReducedMotion, getService, useV2) => {
35
51
  return;
36
52
  }
37
53
  const { addTopComponent } = getService(ProvideComponentServiceDefinition);
38
- const interactionsScript = useV2
39
- ? createV2InteractionsScriptElement(config, isReducedMotion, pageId)
40
- : createInteractionsScriptElement(config, isReducedMotion, pageId);
41
- addTopComponent(interactionsScript);
54
+ if (!useV2) {
55
+ // v1 serializes a single config and has no path for authored-style CSS, so anything beyond
56
+ // that would be silently dropped.
57
+ if (entries.length > 1 || entries.some(({ styles }) => styles?.length)) {
58
+ throw new Error('Multiple interactions config entries and authored styles require Interact v2.');
59
+ }
60
+ addTopComponent(createInteractionsScriptElement(runtimeConfigs[0], isReducedMotion, pageId));
61
+ return;
62
+ }
63
+ addTopComponent(createV2InteractionsScriptElement(runtimeConfigs, isReducedMotion, pageId));
64
+ };
65
+ const getInteractiveComps = (entries) => {
66
+ const keys = new Set();
67
+ for (const entry of entries) {
68
+ getInteractiveKeys(entry).forEach(key => keys.add(key));
69
+ }
70
+ return keys;
42
71
  };
43
- const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, effects }) => {
44
- // add trigger comp
45
- acc.add(key);
46
- // add reaction comps
47
- // there must be a key
48
- effects?.forEach(({ key }) => acc.add(key));
49
- return acc;
50
- }, new Set());
51
72
  export const coreInteractions = (config, getService) => {
52
73
  const { reducedMotion: isReducedMotion } = getService(DeviceInfoDefinition);
53
74
  const { isOpen } = getService(ExperimentsDefinition);
54
- if (isOpen('specs.thunderbolt.vsm_interactions_v2')) {
75
+ const useV2 = isOpen('specs.thunderbolt.vsm_interactions_v2');
76
+ // The v1 runtime has no preset registration and doesn't understand LEGACY_* names; skip
77
+ // aliasing on those paths so named reaction effects remain resolvable.
78
+ const entries = resolveInteractKeyConflicts((useV2 ? getResolvedConfigEntries : getInteractConfigEntries)(config));
79
+ if (useV2) {
55
80
  // Both belong in the head: the preload links only help while the document is still parsing,
56
81
  // and the generated CSS hides elements before their entrance effect, so it has to apply
57
82
  // before the body renders.
58
83
  if (!process.env.browser) {
59
- const css = getV2ConfigCss(config).trim();
84
+ const headContent = getV2HeadContent(entries);
60
85
  // GENERAL rather than setHead's AFTER_SECURITY default: thunderbolt only reads the
61
86
  // after-security bucket on its SEO path, so the default drops this on every normal
62
87
  // request. GENERAL reaches the document as raw markup before `</head>`.
63
- getService(HeadAppenderDefinition).setHead(getV2ModulePreloadHeadContent() + (css ? getV2ConfigStyleHeadContent(css) : ''), HeadContentType.GENERAL);
88
+ if (headContent) {
89
+ getService(HeadAppenderDefinition).setHead(headContent, HeadContentType.GENERAL);
90
+ }
64
91
  }
65
- initRuntime(config, isReducedMotion, getService, true);
92
+ initRuntime(entries, isReducedMotion, getService, true);
66
93
  }
67
94
  else if (isOpen('specs.thunderbolt.interactionsInSsr')) {
68
95
  // Emits the config and loader scripts. Works in both environments: SSR serves markup the
69
96
  // parser executes, and on the client the loader's ref revives it into a script that runs —
70
97
  // which is what pages rendered only on the client (password-protected / members-only,
71
98
  // client-side navigation) need, since they never get a server-rendered document.
72
- initRuntime(config, isReducedMotion, getService, false);
99
+ initRuntime(entries, isReducedMotion, getService, false);
73
100
  }
74
101
  else {
75
- initInteract(config, isReducedMotion);
102
+ initInteract(entries, isReducedMotion);
76
103
  }
77
104
  return {
78
- interactiveComps: getInteractiveComps(config.interactions),
105
+ interactiveComps: getInteractiveComps(entries),
79
106
  };
80
107
  };
81
108
  //# sourceMappingURL=coreInteractions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"coreInteractions.js","sourceRoot":"","sources":["../../src/implementations/coreInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA;AAChF,+FAA+F;AAC/F,+FAA+F;AAC/F,+FAA+F;AAC/F,kFAAkF;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,6DAA6D,CAAA;AAE/G,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AAE9E,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,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10 +1,11 @@
1
+ import type { IInteractionsServiceConfig } from '../definition';
1
2
  export declare const InteractionsService: import("@wix/services-definitions").ServiceFactory<string & {
2
3
  __api: import("..").IInteractionsService;
3
- __config: import("@wix/interact").InteractConfig;
4
+ __config: IInteractionsServiceConfig;
4
5
  isServiceDefinition?: boolean;
5
- } & import("..").IInteractionsService, import("@wix/interact").InteractConfig>;
6
+ } & import("..").IInteractionsService, IInteractionsServiceConfig>;
6
7
  export declare const InteractionsServiceExternal: import("@wix/services-definitions").ServiceFactory<string & {
7
8
  __api: import("..").IInteractionsService;
8
- __config: import("@wix/interact").InteractConfig;
9
+ __config: IInteractionsServiceConfig;
9
10
  isServiceDefinition?: boolean;
10
- } & import("..").IInteractionsService, import("@wix/interact").InteractConfig>;
11
+ } & import("..").IInteractionsService, IInteractionsServiceConfig>;
@@ -1,3 +1,3 @@
1
1
  import type { FunctionComponent } from 'react';
2
- import type { InteractConfig } from '@wix/interact';
3
- export declare const createV2InteractionsScriptElement: (config: InteractConfig, isReducedMotion: boolean, pageId: string) => FunctionComponent;
2
+ import type { InteractConfig } from '@wix/interact-v2';
3
+ export declare const createV2InteractionsScriptElement: (config: InteractConfig | InteractConfig[], isReducedMotion: boolean, pageId: string) => FunctionComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../src/implementations/v2/InteractionsScriptElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAE5E,MAAM,0BAA0B,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAE1E;;;GAGG;AACH,MAAM,+BAA+B,GAAG,CAAC,MAAsB,EAAU,EAAE,CACvE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;AAEnD,MAAM,CAAC,MAAM,iCAAiC,GAC1C,CAAC,MAAsB,EAAE,eAAwB,EAAE,MAAc,EAAqB,EAAE,CACxF,GAAG,EAAE;IACD,qFAAqF;IACrF,oFAAoF;IACpF,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,QAAQ,GAAG,uBAAuB,UAAU,EAAE,CAAA;IACpD,MAAM,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;IAC3F,MAAM,WAAW,GAAG;QAChB,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,+BAA+B,CAAC,MAAM,CAAC,EAAE;KAC7F,CAAA;IACD,MAAM,WAAW,GAAG;QAChB,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,yBAAyB,EAAE;KAC/E,CAAA;IAED,OAAO,CACH;QACI,gCAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,KAAM,WAAW,GAAI;QACjE,gCACI,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,uBAAuB,UAAU,EAAE,EACvC,GAAG,EAAE,mBAAmB,KACpB,WAAW,GACjB,CACH,CACN,CAAA;AACL,CAAC,CAAA"}
1
+ {"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../src/implementations/v2/InteractionsScriptElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAA;AAE5E,MAAM,0BAA0B,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAE1E;;;GAGG;AACH,MAAM,+BAA+B,GAAG,CAAC,MAAyC,EAAU,EAAE,CAC1F,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;AAEnD,MAAM,CAAC,MAAM,iCAAiC,GAC1C,CAAC,MAAyC,EAAE,eAAwB,EAAE,MAAc,EAAqB,EAAE,CAC3G,GAAG,EAAE;IACD,qFAAqF;IACrF,oFAAoF;IACpF,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAC7C,MAAM,QAAQ,GAAG,uBAAuB,UAAU,EAAE,CAAA;IACpD,MAAM,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;IAC3F,MAAM,WAAW,GAAG;QAChB,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,+BAA+B,CAAC,MAAM,CAAC,EAAE;KAC7F,CAAA;IACD,MAAM,WAAW,GAAG;QAChB,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,yBAAyB,EAAE;KAC/E,CAAA;IAED,OAAO,CACH;QACI,gCAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,KAAM,WAAW,GAAI;QACjE,gCACI,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,uBAAuB,UAAU,EAAE,EACvC,GAAG,EAAE,mBAAmB,KACpB,WAAW,GACjB,CACH,CACN,CAAA;AACL,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import type { InteractConfigEntry } from '../../definition';
2
+ export declare const getAuthoredStylesCss: (entries: InteractConfigEntry[]) => string;
@@ -0,0 +1,91 @@
1
+ const SELECTOR_TOKEN = /"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[()[\]]|,/g;
2
+ const escapeCssString = (value) => value
3
+ .replace(/\\/g, '\\\\')
4
+ .replace(/"/g, '\\"')
5
+ .replace(/\n/g, '\\a ')
6
+ .replace(/\r/g, '\\d ')
7
+ .replace(/\f/g, '\\c ');
8
+ const splitSelectorList = (selector) => {
9
+ const parts = [];
10
+ let depth = 0;
11
+ let start = 0;
12
+ SELECTOR_TOKEN.lastIndex = 0;
13
+ for (let match = SELECTOR_TOKEN.exec(selector); match; match = SELECTOR_TOKEN.exec(selector)) {
14
+ const token = match[0];
15
+ if (token === '(' || token === '[') {
16
+ depth++;
17
+ }
18
+ else if (token === ')' || token === ']') {
19
+ depth--;
20
+ }
21
+ else if (token === ',' && depth === 0) {
22
+ parts.push(selector.slice(start, match.index));
23
+ start = match.index + 1;
24
+ }
25
+ }
26
+ parts.push(selector.slice(start));
27
+ return parts.map(part => part.trim()).filter(Boolean);
28
+ };
29
+ const indentCssBlock = (css) => css
30
+ .split('\n')
31
+ .map(line => (line ? ` ${line}` : line))
32
+ .join('\n');
33
+ const renderProperties = (properties) => Object.entries(properties)
34
+ .map(([property, value]) => ` ${property}: ${value};`)
35
+ .join('\n');
36
+ const wrapWithConditions = (block, rule) => {
37
+ let result = block;
38
+ if (rule['@container']) {
39
+ result = `@container ${rule['@container']} {\n${indentCssBlock(result)}\n}`;
40
+ }
41
+ if (rule['@media']) {
42
+ result = `@media ${rule['@media']} {\n${indentCssBlock(result)}\n}`;
43
+ }
44
+ if (rule['@supports']) {
45
+ result = `@supports ${rule['@supports']} {\n${indentCssBlock(result)}\n}`;
46
+ }
47
+ return result;
48
+ };
49
+ const buildRuleSelector = (namespace, rule) => {
50
+ const scopeWrapper = `[data-interact-key="${escapeCssString(namespace)}"]`;
51
+ const scopeRoot = `${scopeWrapper} > :first-child`;
52
+ if (!rule.key) {
53
+ if (!rule.selector) {
54
+ return scopeRoot;
55
+ }
56
+ return splitSelectorList(rule.selector)
57
+ .map(selector => `${scopeRoot} ${selector}`)
58
+ .join(', ');
59
+ }
60
+ const escapedKey = escapeCssString(rule.key);
61
+ const keyWrapper = rule.key === namespace ? scopeWrapper : `${scopeWrapper} [data-interact-key="${escapedKey}"]`;
62
+ const keyRoot = `${keyWrapper} > :first-child`;
63
+ if (!rule.selector) {
64
+ return keyRoot;
65
+ }
66
+ const separator = /^\s/.test(rule.selector) ? ' ' : '';
67
+ return splitSelectorList(rule.selector)
68
+ .map(selector => `${keyRoot}${separator}${selector}`)
69
+ .join(', ');
70
+ };
71
+ const getEntryStylesCss = ({ namespace, styles = [] }) => {
72
+ if (!styles.length) {
73
+ return '';
74
+ }
75
+ if (!namespace) {
76
+ throw new Error('Interactions config entries with authored styles must define a namespace.');
77
+ }
78
+ return styles
79
+ .map(rule => {
80
+ const properties = renderProperties(rule.properties);
81
+ if (!properties) {
82
+ return '';
83
+ }
84
+ const block = `${buildRuleSelector(namespace, rule)} {\n${properties}\n}`;
85
+ return wrapWithConditions(block, rule);
86
+ })
87
+ .filter(Boolean)
88
+ .join('\n\n');
89
+ };
90
+ export const getAuthoredStylesCss = (entries) => entries.map(getEntryStylesCss).filter(Boolean).join('\n\n');
91
+ //# sourceMappingURL=authoredStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoredStyles.js","sourceRoot":"","sources":["../../../src/implementations/v2/authoredStyles.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAG,gDAAgD,CAAA;AAEvE,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE,CAC9C,KAAK;KACA,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;KACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;KACpB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;KACtB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;KACtB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AAE/B,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAY,EAAE;IACrD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,GAAG,CAA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AAC,OAAO,UAAU,KAAK,CAAA;QACzE,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,MAAM,CAAC,CAAA;AACrB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAA8B,EAAU,EAAE,CAC3E,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export declare const INTERACT_V2_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/interact@2.5.14/dist/es/web.min.js";
2
- export declare const WIX_MOTION_PRESETS_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.0.0/+esm";
2
+ export declare const LEGACY_WIX_MOTION_PRESETS_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.2.0/+esm";
3
+ export declare const MOTION_PRESETS_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/motion-presets@1.0.7/dist/browser/motion-presets.min.js";
@@ -1,3 +1,4 @@
1
1
  export const INTERACT_V2_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/interact@2.5.14/dist/es/web.min.js';
2
- export const WIX_MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.0.0/+esm';
2
+ export const LEGACY_WIX_MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.2.0/+esm';
3
+ export const MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/motion-presets@1.0.7/dist/browser/motion-presets.min.js';
3
4
  //# sourceMappingURL=cdnUrls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdnUrls.js","sourceRoot":"","sources":["../../../src/implementations/v2/cdnUrls.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,sEAAsE,CAAA;AAE5G,MAAM,CAAC,MAAM,6BAA6B,GAAG,iEAAiE,CAAA"}
1
+ {"version":3,"file":"cdnUrls.js","sourceRoot":"","sources":["../../../src/implementations/v2/cdnUrls.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,sEAAsE,CAAA;AAE5G,MAAM,CAAC,MAAM,oCAAoC,GAAG,iEAAiE,CAAA;AAErH,MAAM,CAAC,MAAM,yBAAyB,GAClC,2FAA2F,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { InteractConfig } from '@wix/interact';
1
+ import type { InteractConfig } from '@wix/interact-v2';
2
2
  /** Emits `cursor: pointer` for click interaction triggers (`'activate' || 'click'`), one rule per unique source selector. */
3
3
  export declare const getClickTriggerCss: (config: InteractConfig) => string;
@@ -1,3 +1,3 @@
1
- import type { InteractConfig } from '@wix/interact';
1
+ import type { InteractConfig } from '@wix/interact-v2';
2
2
  /** Emit animation FOUC CSS and click-trigger cursor rules. */
3
3
  export declare const getV2ConfigCss: (config: InteractConfig) => string;
@@ -1,8 +1,8 @@
1
1
  import { generate, Interact } from '@wix/interact-v2';
2
- import * as motionPresets from '@wix/wix-motion-presets';
3
2
  import { getClickTriggerCss } from './clickTriggerCss';
3
+ import { motionPresets } from './motionPresets';
4
4
  // Interact's registry is process-global. This module is only pulled into the server bundle
5
- // (`process.env.browser` DCE), so the namespace is registered once per Node process.
5
+ // (`process.env.browser` DCE), so both namespaces are registered once per Node process.
6
6
  Interact.registerEffects(motionPresets);
7
7
  /** Emit animation FOUC CSS and click-trigger cursor rules. */
8
8
  export const getV2ConfigCss = (config) => {
@@ -1 +1 @@
1
- {"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,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