@wix/site-service-interactions 1.0.10 → 1.0.11

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 (53) hide show
  1. package/cjs/build/implementations/coreInteractions.js +31 -24
  2. package/cjs/build/implementations/coreInteractions.js.map +1 -1
  3. package/cjs/build/implementations/v2/InteractionsScriptElement.js +1 -1
  4. package/cjs/build/implementations/v2/InteractionsScriptElement.js.map +1 -1
  5. package/cjs/build/implementations/v2/cdnUrls.d.ts +2 -2
  6. package/cjs/build/implementations/v2/cdnUrls.js +2 -2
  7. package/cjs/build/implementations/v2/cdnUrls.js.map +1 -1
  8. package/cjs/build/implementations/v2/configCss.d.ts +1 -1
  9. package/cjs/build/implementations/v2/configCss.js +40 -5
  10. package/cjs/build/implementations/v2/configCss.js.map +1 -1
  11. package/cjs/build/implementations/v2/interactionsScriptContent.d.ts +2 -3
  12. package/cjs/build/implementations/v2/interactionsScriptContent.js +23 -39
  13. package/cjs/build/implementations/v2/interactionsScriptContent.js.map +1 -1
  14. package/dist/implementations/coreInteractions.js +28 -21
  15. package/dist/implementations/coreInteractions.js.map +1 -1
  16. package/dist/implementations/v2/InteractionsScriptElement.js +1 -1
  17. package/dist/implementations/v2/InteractionsScriptElement.js.map +1 -1
  18. package/dist/implementations/v2/cdnUrls.d.ts +2 -2
  19. package/dist/implementations/v2/cdnUrls.js +2 -2
  20. package/dist/implementations/v2/cdnUrls.js.map +1 -1
  21. package/dist/implementations/v2/configCss.d.ts +1 -1
  22. package/dist/implementations/v2/configCss.js +6 -4
  23. package/dist/implementations/v2/configCss.js.map +1 -1
  24. package/dist/implementations/v2/interactionsScriptContent.d.ts +2 -3
  25. package/dist/implementations/v2/interactionsScriptContent.js +23 -39
  26. package/dist/implementations/v2/interactionsScriptContent.js.map +1 -1
  27. package/package.json +5 -4
  28. package/src/implementations/coreInteractions.ts +31 -24
  29. package/src/implementations/v2/InteractionsScriptElement.tsx +1 -1
  30. package/src/implementations/v2/cdnUrls.ts +2 -3
  31. package/src/implementations/v2/configCss.ts +11 -5
  32. package/src/implementations/v2/interactionsScriptContent.ts +9 -36
  33. package/cjs/build/implementations/v2/motionPresets.d.ts +0 -13
  34. package/cjs/build/implementations/v2/motionPresets.js +0 -54
  35. package/cjs/build/implementations/v2/motionPresets.js.map +0 -1
  36. package/cjs/build/implementations/v2/namedEffectTypes.d.ts +0 -2
  37. package/cjs/build/implementations/v2/namedEffectTypes.js +0 -42
  38. package/cjs/build/implementations/v2/namedEffectTypes.js.map +0 -1
  39. package/cjs/build/implementations/v2/registerConfigEffects.d.ts +0 -6
  40. package/cjs/build/implementations/v2/registerConfigEffects.js +0 -27
  41. package/cjs/build/implementations/v2/registerConfigEffects.js.map +0 -1
  42. package/dist/implementations/v2/motionPresets.d.ts +0 -13
  43. package/dist/implementations/v2/motionPresets.js +0 -16
  44. package/dist/implementations/v2/motionPresets.js.map +0 -1
  45. package/dist/implementations/v2/namedEffectTypes.d.ts +0 -2
  46. package/dist/implementations/v2/namedEffectTypes.js +0 -38
  47. package/dist/implementations/v2/namedEffectTypes.js.map +0 -1
  48. package/dist/implementations/v2/registerConfigEffects.d.ts +0 -6
  49. package/dist/implementations/v2/registerConfigEffects.js +0 -23
  50. package/dist/implementations/v2/registerConfigEffects.js.map +0 -1
  51. package/src/implementations/v2/motionPresets.ts +0 -26
  52. package/src/implementations/v2/namedEffectTypes.ts +0 -52
  53. package/src/implementations/v2/registerConfigEffects.ts +0 -31
@@ -1,51 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.coreInteractions = void 0;
4
- const web_1 = require("@wix/interact/web");
4
+ const interact_1 = require("@wix/interact");
5
5
  const definition_1 = require("@wix/site-service-device-info/definition");
6
6
  const definition_2 = require("@wix/site-service-experiments/definition");
7
- const definition_3 = require("@wix/site-service-pages/definition");
7
+ // Deliberately the deprecated pages service. Thunderbolt registers the site-service-pages page
8
+ // config only for sites that list it in `requiredServicesMap`, which ordinary sites do not, so
9
+ // `currentPage` falls back to EMPTY_PAGE and the id is ''. The legacy pages feature carries an
10
+ // explicit `interactionsFeature` escape hatch, so its config is populated for us.
11
+ const definition_3 = require("@wix/viewer-service-pages/definition");
8
12
  const definition_4 = require("@wix/site-service-head-appender/definition");
13
+ const types_1 = require("@wix/site-service-head-appender/types");
9
14
  const provide_component_1 = require("@wix/services-manager-react/core-services/provide-component");
10
15
  const InteractionsScriptElement_1 = require("./InteractionsScriptElement");
11
16
  const InteractionsScriptElement_2 = require("./v2/InteractionsScriptElement");
12
17
  const configCss_1 = require("./v2/configCss");
13
18
  const configStyleHeadContent_1 = require("./v2/configStyleHeadContent");
14
19
  const interactionsScriptContent_1 = require("./v2/interactionsScriptContent");
15
- const registerConfigEffects_1 = require("./v2/registerConfigEffects");
16
20
  const initInteract = (config, isReducedMotion) => {
17
- // The bundled runtime is v2, where named effects come from a separate package the loader
18
- // script imports on the SSR path. Here they have to be registered before create().
19
- (0, registerConfigEffects_1.registerConfigEffects)(config);
20
- web_1.Interact.forceReducedMotion = isReducedMotion;
21
- web_1.Interact.setup({
21
+ // Bundled runtime is v1. v2 on the client is the CDN loader.
22
+ interact_1.Interact.forceReducedMotion = isReducedMotion;
23
+ interact_1.Interact.setup({
22
24
  scrollOptionsGetter: () => globalThis.document.getElementById('site-root'),
23
25
  allowA11yTriggers: true,
24
26
  viewEnter: {
25
27
  useSafeViewEnter: true,
26
28
  },
27
29
  });
28
- web_1.Interact.create(config);
30
+ interact_1.Interact.create(config);
29
31
  };
30
32
  const initRuntime = (config, isReducedMotion, getService, useV2) => {
31
33
  if (!config.interactions?.length) {
32
34
  return;
33
35
  }
34
- const pageId = getService(definition_3.PagesDefinition).currentPage?.id;
36
+ const pageId = getService(definition_3.PagesDefinition).currentPageId();
35
37
  if (!pageId) {
36
38
  return;
37
39
  }
38
40
  const { addTopComponent } = getService(provide_component_1.ProvideComponentServiceDefinition);
39
- if (!useV2) {
40
- addTopComponent((0, InteractionsScriptElement_1.createInteractionsScriptElement)(config, isReducedMotion, pageId));
41
- return;
42
- }
43
- // Both belong in the head: the preload links only help while the document is still parsing,
44
- // and the generated CSS hides elements before their entrance effect, so it has to apply
45
- // before the body renders.
46
- const css = (0, configCss_1.getV2ConfigCss)(config).trim();
47
- getService(definition_4.HeadAppenderDefinition).setHead((0, interactionsScriptContent_1.getV2ModulePreloadHeadContent)(config) + (css ? (0, configStyleHeadContent_1.getV2ConfigStyleHeadContent)(css) : ''));
48
- addTopComponent((0, InteractionsScriptElement_2.createV2InteractionsScriptElement)(config, isReducedMotion, pageId));
41
+ const interactionsScript = useV2
42
+ ? (0, InteractionsScriptElement_2.createV2InteractionsScriptElement)(config, isReducedMotion, pageId)
43
+ : (0, InteractionsScriptElement_1.createInteractionsScriptElement)(config, isReducedMotion, pageId);
44
+ addTopComponent(interactionsScript);
49
45
  };
50
46
  const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, effects }) => {
51
47
  // add trigger comp
@@ -58,14 +54,25 @@ const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, e
58
54
  const coreInteractions = (config, getService) => {
59
55
  const { reducedMotion: isReducedMotion } = getService(definition_1.DeviceInfoDefinition);
60
56
  const { isOpen } = getService(definition_2.ExperimentsDefinition);
61
- if (isOpen('specs.thunderbolt.interactionsInSsr')) {
57
+ if (isOpen('specs.thunderbolt.vsm_interactions_v2')) {
58
+ // Both belong in the head: the preload links only help while the document is still parsing,
59
+ // and the generated CSS hides elements before their entrance effect, so it has to apply
60
+ // before the body renders.
61
+ if (!process.env.browser) {
62
+ const css = (0, configCss_1.getV2ConfigCss)(config).trim();
63
+ // GENERAL rather than setHead's AFTER_SECURITY default: thunderbolt only reads the
64
+ // after-security bucket on its SEO path, so the default drops this on every normal
65
+ // request. GENERAL reaches the document as raw markup before `</head>`.
66
+ getService(definition_4.HeadAppenderDefinition).setHead((0, interactionsScriptContent_1.getV2ModulePreloadHeadContent)() + (css ? (0, configStyleHeadContent_1.getV2ConfigStyleHeadContent)(css) : ''), types_1.HeadContentType.GENERAL);
67
+ }
68
+ initRuntime(config, isReducedMotion, getService, true);
69
+ }
70
+ else if (isOpen('specs.thunderbolt.interactionsInSsr')) {
62
71
  // Emits the config and loader scripts. Works in both environments: SSR serves markup the
63
72
  // parser executes, and on the client the loader's ref revives it into a script that runs —
64
73
  // which is what pages rendered only on the client (password-protected / members-only,
65
74
  // client-side navigation) need, since they never get a server-rendered document.
66
- // v2 is only reachable from here: it ships as a loader script plus generated CSS, both of
67
- // which exist only on this path.
68
- initRuntime(config, isReducedMotion, getService, isOpen('specs.thunderbolt.vsm_interactions_v2'));
75
+ initRuntime(config, isReducedMotion, getService, false);
69
76
  }
70
77
  else {
71
78
  initInteract(config, isReducedMotion);
@@ -1 +1 @@
1
- {"version":3,"file":"coreInteractions.js","sourceRoot":"","sources":["../../../src/implementations/coreInteractions.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,yEAA+E;AAC/E,yEAAgF;AAChF,mEAAoE;AACpE,2EAAmF;AACnF,mGAA+G;AAE/G,2EAA6E;AAC7E,8EAAkF;AAClF,8CAA+C;AAC/C,wEAAyE;AACzE,8EAA8E;AAC9E,sEAAkE;AAElE,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,eAAwB,EAAE,EAAE;IACtE,yFAAyF;IACzF,mFAAmF;IACnF,IAAA,6CAAqB,EAAC,MAAM,CAAC,CAAA;IAC7B,cAAQ,CAAC,kBAAkB,GAAG,eAAe,CAAA;IAC7C,cAAQ,CAAC,KAAK,CAAC;QACX,mBAAmB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC;QAC1E,iBAAiB,EAAE,IAAI;QACvB,SAAS,EAAE;YACP,gBAAgB,EAAE,IAAI;SACzB;KACJ,CAAC,CAAA;IACF,cAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC,CAAA;AAED,MAAM,WAAW,G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G,CAAC,GAAG,CAAC,GAAI,CAAC,CAAC,CAAA;IAE5C,OAAO,GAAG,CAAA;AACd,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAA;AAElB,MAAM,gBAAgB,GAAG,CAAC,MAAsB,EAAE,UAAyC,EAAE,EAAE;IAClG,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,UAAU,CAAC,iCAAoB,CAAC,CAAA;IAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAqB,CAAC,CAAA;IAEpD,IAAI,MAAM,CAAC,qCAAqC,CAAC,EAAE,CAAC;QAChD,yFAAyF;QACzF,2FAA2F;QAC3F,sFAAsF;QACtF,iFAAiF;QACjF,0FAA0F;QAC1F,iCAAiC;QACjC,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,CAAC,uCAAuC,CAAC,CAAC,CAAA;IACrG,CAAC;SAAM,CAAC;QACJ,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACzC,CAAC;IAED,OAAO;QACH,gBAAgB,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;KAC7D,CAAA;AACL,CAAC,CAAA;AAnBY,QAAA,gBAAgB,oBAmB5B"}
1
+ {"version":3,"file":"coreInteractions.js","sourceRoot":"","sources":["../../../src/implementations/coreInteractions.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AAExC,yEAA+E;AAC/E,yEAAgF;AAChF,+FAA+F;AAC/F,+FAA+F;AAC/F,+FAA+F;AAC/F,kFAAkF;AAClF,qEAAsE;AACtE,2EAAmF;AACnF,iEAAuE;AACvE,mGAA+G;AAE/G,2EAA6E;AAC7E,8EAAkF;AAClF,8CAA+C;AAC/C,wEAAyE;AACzE,8EAA8E;AAE9E,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,eAAwB,EAAE,EAAE;IACtE,6DAA6D;IAC7D,mBAAQ,CAAC,kBAAkB,GAAG,eAAe,CAAA;I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7D,CAAA;AACL,CAAC,CAAA;AAjCY,QAAA,gBAAgB,oBAiC5B"}
@@ -18,7 +18,7 @@ const createV2InteractionsScriptElement = (config, isReducedMotion, pageId) => (
18
18
  // script delimiters and template-literal syntax while keeping the ID deterministic.
19
19
  const safePageId = encodeURIComponent(pageId);
20
20
  const configId = `interactions-config-${safePageId}`;
21
- const interactionsScriptContent = (0, interactionsScriptContent_1.getV2InteractionsScriptContent)(config, configId, isReducedMotion);
21
+ const interactionsScriptContent = (0, interactionsScriptContent_1.getV2InteractionsScriptContent)(configId, isReducedMotion);
22
22
  const configProps = {
23
23
  [DANGEROUSLY_SET_INNER_HTML.join('')]: { __html: serializeConfigForScriptElement(config) },
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../../src/implementations/v2/InteractionsScriptElement.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGzB,gEAA4D;AAC5D,2EAA4E;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;AAE5C,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,IAAA,0DAA8B,EAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAA;IACnG,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,0CAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,KAAM,WAAW,GAAI;QACjE,0CACI,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,uBAAuB,UAAU,EAAE,EACvC,GAAG,EAAE,yCAAmB,KACpB,WAAW,GACjB,CACH,CACN,CAAA;AACL,CAAC,CAAA;AA1BQ,QAAA,iCAAiC,qCA0BzC"}
1
+ {"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../../src/implementations/v2/InteractionsScriptElement.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGzB,gEAA4D;AAC5D,2EAA4E;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;AAE5C,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,IAAA,0DAA8B,EAAC,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,0CAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,KAAM,WAAW,GAAI;QACjE,0CACI,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,uBAAuB,UAAU,EAAE,EACvC,GAAG,EAAE,yCAAmB,KACpB,WAAW,GACjB,CACH,CACN,CAAA;AACL,CAAC,CAAA;AA1BQ,QAAA,iCAAiC,qCA0BzC"}
@@ -1,2 +1,2 @@
1
- export declare const INTERACT_V2_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/interact@2/dist/es/web.min.js";
2
- export declare const WIX_MOTION_PRESETS_IMPORT_URL = "https://static.parastorage.com/services/wix-motion-presets/dist/wix-motion-presets.esm.min.js";
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";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WIX_MOTION_PRESETS_IMPORT_URL = exports.INTERACT_V2_IMPORT_URL = void 0;
4
- exports.INTERACT_V2_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/interact@2/dist/es/web.min.js';
5
- exports.WIX_MOTION_PRESETS_IMPORT_URL = 'https://static.parastorage.com/services/wix-motion-presets/dist/wix-motion-presets.esm.min.js';
4
+ exports.INTERACT_V2_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/interact@2.5.14/dist/es/web.min.js';
5
+ exports.WIX_MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.0.0/+esm';
6
6
  //# sourceMappingURL=cdnUrls.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cdnUrls.js","sourceRoot":"","sources":["../../../../src/implementations/v2/cdnUrls.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,iEAAiE,CAAA;AAE1F,QAAA,6BAA6B,GACtC,+FAA+F,CAAA"}
1
+ {"version":3,"file":"cdnUrls.js","sourceRoot":"","sources":["../../../../src/implementations/v2/cdnUrls.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,sEAAsE,CAAA;AAE/F,QAAA,6BAA6B,GAAG,iEAAiE,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import type { InteractConfig } from '@wix/interact';
2
- /** Register config-used presets, then emit animation FOUC CSS and click-trigger cursor rules. */
2
+ /** Emit animation FOUC CSS and click-trigger cursor rules. */
3
3
  export declare const getV2ConfigCss: (config: InteractConfig) => string;
@@ -1,13 +1,48 @@
1
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
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.getV2ConfigCss = void 0;
4
- const interact_1 = require("@wix/interact");
37
+ const interact_v2_1 = require("@wix/interact-v2");
38
+ const motionPresets = __importStar(require("@wix/wix-motion-presets"));
5
39
  const clickTriggerCss_1 = require("./clickTriggerCss");
6
- const registerConfigEffects_1 = require("./registerConfigEffects");
7
- /** Register config-used presets, then emit animation FOUC CSS and click-trigger cursor rules. */
40
+ // Interact's registry is process-global. This module is only pulled into the server bundle
41
+ // (`process.env.browser` DCE), so the namespace is registered once per Node process.
42
+ interact_v2_1.Interact.registerEffects(motionPresets);
43
+ /** Emit animation FOUC CSS and click-trigger cursor rules. */
8
44
  const getV2ConfigCss = (config) => {
9
- (0, registerConfigEffects_1.registerConfigEffects)(config);
10
- const animationCss = (0, interact_1.generate)(config, true).trim();
45
+ const animationCss = (0, interact_v2_1.generate)(config, true).trim();
11
46
  const clickCss = (0, clickTriggerCss_1.getClickTriggerCss)(config).trim();
12
47
  return [animationCss, clickCss].filter(Boolean).join('\n');
13
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AAExC,uDAAsD;AACtD,mEAA+D;AAE/D,iGAAiG;AAC1F,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAC7D,IAAA,6CAAqB,EAAC,MAAM,CAAC,CAAA;IAC7B,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IAClD,MAAM,QAAQ,GAAG,IAAA,oCAAkB,EAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC,CAAA;AANY,QAAA,cAAc,kBAM1B"}
1
+ {"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqD;AAGrD,uEAAwD;AACxD,uDAAsD;AAItD,2FAA2F;AAC3F,qFAAqF;AACrF,sBAAQ,CAAC,eAAe,CAAC,aAA0C,CAAC,CAAA;AAEpE,8DAA8D;AACvD,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAC7D,MAAM,YAAY,GAAG,IAAA,sBAAQ,EAAC,MAA0B,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IACtE,MAAM,QAAQ,GAAG,IAAA,oCAAkB,EAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B"}
@@ -1,9 +1,8 @@
1
- import type { InteractConfig } from '@wix/interact';
2
1
  /**
3
2
  * The loader reaches these modules through dynamic `import()`, which the preload scanner cannot
4
3
  * see, so without the links the fetches only start once the loader runs. No `crossorigin`: a bare
5
4
  * `modulepreload` fetches with the same credentials mode as a bare `import()`, and a mismatch
6
5
  * would download each module twice.
7
6
  */
8
- export declare const getV2ModulePreloadHeadContent: (config: InteractConfig) => string;
9
- export declare const getV2InteractionsScriptContent: (config: InteractConfig, configId: string, isReducedMotion: boolean) => string;
7
+ export declare const getV2ModulePreloadHeadContent: () => string;
8
+ export declare const getV2InteractionsScriptContent: (configId: string, isReducedMotion: boolean) => string;
@@ -2,51 +2,35 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getV2InteractionsScriptContent = exports.getV2ModulePreloadHeadContent = void 0;
4
4
  const cdnUrls_1 = require("./cdnUrls");
5
- const namedEffectTypes_1 = require("./namedEffectTypes");
6
- const motionPresets_1 = require("./motionPresets");
7
- const getPresetTypes = (config) => (0, motionPresets_1.filterKnownPresetTypes)((0, namedEffectTypes_1.collectNamedEffectTypes)(config));
8
- const getModuleUrls = (presetTypes) => presetTypes.length > 0 ? [cdnUrls_1.INTERACT_V2_IMPORT_URL, cdnUrls_1.WIX_MOTION_PRESETS_IMPORT_URL] : [cdnUrls_1.INTERACT_V2_IMPORT_URL];
9
5
  /**
10
6
  * The loader reaches these modules through dynamic `import()`, which the preload scanner cannot
11
7
  * see, so without the links the fetches only start once the loader runs. No `crossorigin`: a bare
12
8
  * `modulepreload` fetches with the same credentials mode as a bare `import()`, and a mismatch
13
9
  * would download each module twice.
14
10
  */
15
- const getV2ModulePreloadHeadContent = (config) => getModuleUrls(getPresetTypes(config))
16
- .map(url => `<link rel="modulepreload" href="${url}">`)
17
- .join('');
11
+ const getV2ModulePreloadHeadContent = () => `<link rel="modulepreload" href="${cdnUrls_1.INTERACT_V2_IMPORT_URL}"><link rel="modulepreload" href="${cdnUrls_1.WIX_MOTION_PRESETS_IMPORT_URL}">`;
18
12
  exports.getV2ModulePreloadHeadContent = getV2ModulePreloadHeadContent;
19
- const getV2InteractionsScriptContent = (config, configId, isReducedMotion) => {
20
- const presetTypes = getPresetTypes(config);
21
- const bindings = ['{ Interact }'];
22
- const imports = getModuleUrls(presetTypes).map(url => `import(\`${url}\`)`);
23
- if (presetTypes.length > 0) {
24
- bindings.push(`{ ${presetTypes.join(', ')} }`);
25
- }
26
- const registerEffects = presetTypes.length > 0 ? ` Interact.registerEffects({ ${presetTypes.join(', ')} })` : undefined;
27
- return [
28
- `const configElement = document.getElementById(\`${configId}\`)`,
29
- 'if (configElement) {',
30
- ' const config = JSON.parse(configElement.textContent)',
31
- ` const [${bindings.join(', ')}] = await Promise.all([`,
32
- ...imports.map(importCall => ` ${importCall},`),
33
- ' ])',
34
- registerEffects,
35
- ` Interact.forceReducedMotion = ${isReducedMotion}`,
36
- ' Interact.setup({',
37
- ' scrollOptionsGetter: function () {',
38
- ' return document.getElementById(`site-root`)',
39
- ' },',
40
- ' allowA11yTriggers: true,',
41
- ' viewEnter: {',
42
- ' useSafeViewEnter: true,',
43
- ' },',
44
- ' })',
45
- ' Interact.create(config)',
46
- '}',
47
- ]
48
- .filter((line) => line !== undefined)
49
- .join('\n');
50
- };
13
+ const getV2InteractionsScriptContent = (configId, isReducedMotion) => [
14
+ `const configElement = document.getElementById(\`${configId}\`)`,
15
+ 'if (configElement) {',
16
+ ' const config = JSON.parse(configElement.textContent)',
17
+ ' const [{ Interact }, presets] = await Promise.all([',
18
+ ` import(\`${cdnUrls_1.INTERACT_V2_IMPORT_URL}\`),`,
19
+ ` import(\`${cdnUrls_1.WIX_MOTION_PRESETS_IMPORT_URL}\`),`,
20
+ ' ])',
21
+ ' Interact.registerEffects(presets)',
22
+ ` Interact.forceReducedMotion = ${isReducedMotion}`,
23
+ ' Interact.setup({',
24
+ ' scrollOptionsGetter: function () {',
25
+ ' return document.getElementById(`site-root`)',
26
+ ' },',
27
+ ' allowA11yTriggers: true,',
28
+ ' viewEnter: {',
29
+ ' useSafeViewEnter: true,',
30
+ ' },',
31
+ ' })',
32
+ ' Interact.create(config)',
33
+ '}',
34
+ ].join('\n');
51
35
  exports.getV2InteractionsScriptContent = getV2InteractionsScriptContent;
52
36
  //# sourceMappingURL=interactionsScriptContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactionsScriptContent.js","s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I,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IAEpG,OAAO;QACH,mDAAmD,QAAQ,KAAK;QAChE,sBAAsB;QACtB,wDAAwD;QACxD,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB;QACxD,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,UAAU,GAAG,CAAC;QAClD,MAAM;QACN,eAAe;QACf,mCAAmC,eAAe,EAAE;QACpD,oBAAoB;QACpB,wCAAwC;QACxC,mDAAmD;QACnD,QAAQ;QACR,8BAA8B;QAC9B,kBAAkB;QAClB,+BAA+B;QAC/B,QAAQ;QACR,MAAM;QACN,2BAA2B;QAC3B,GAAG;KACN;SACI,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC;SACpD,IAAI,CAAC,IAAI,CAAC,CAAA;AACnB,CAAC,CAAA;AAvCY,QAAA,8BAA8B,kCAuC1C"}
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,19 +1,21 @@
1
- import { Interact } from '@wix/interact/web';
1
+ import { Interact } from '@wix/interact';
2
2
  import { DeviceInfoDefinition } from '@wix/site-service-device-info/definition';
3
3
  import { ExperimentsDefinition } from '@wix/site-service-experiments/definition';
4
- import { PagesDefinition } from '@wix/site-service-pages/definition';
4
+ // Deliberately the deprecated pages service. Thunderbolt registers the site-service-pages page
5
+ // config only for sites that list it in `requiredServicesMap`, which ordinary sites do not, so
6
+ // `currentPage` falls back to EMPTY_PAGE and the id is ''. The legacy pages feature carries an
7
+ // explicit `interactionsFeature` escape hatch, so its config is populated for us.
8
+ import { PagesDefinition } from '@wix/viewer-service-pages/definition';
5
9
  import { HeadAppenderDefinition } from '@wix/site-service-head-appender/definition';
10
+ import { HeadContentType } from '@wix/site-service-head-appender/types';
6
11
  import { ProvideComponentServiceDefinition } from '@wix/services-manager-react/core-services/provide-component';
7
12
  import { createInteractionsScriptElement } from './InteractionsScriptElement';
8
13
  import { createV2InteractionsScriptElement } from './v2/InteractionsScriptElement';
9
14
  import { getV2ConfigCss } from './v2/configCss';
10
15
  import { getV2ConfigStyleHeadContent } from './v2/configStyleHeadContent';
11
16
  import { getV2ModulePreloadHeadContent } from './v2/interactionsScriptContent';
12
- import { registerConfigEffects } from './v2/registerConfigEffects';
13
17
  const initInteract = (config, isReducedMotion) => {
14
- // The bundled runtime is v2, where named effects come from a separate package the loader
15
- // script imports on the SSR path. Here they have to be registered before create().
16
- registerConfigEffects(config);
18
+ // Bundled runtime is v1. v2 on the client is the CDN loader.
17
19
  Interact.forceReducedMotion = isReducedMotion;
18
20
  Interact.setup({
19
21
  scrollOptionsGetter: () => globalThis.document.getElementById('site-root'),
@@ -28,21 +30,15 @@ const initRuntime = (config, isReducedMotion, getService, useV2) => {
28
30
  if (!config.interactions?.length) {
29
31
  return;
30
32
  }
31
- const pageId = getService(PagesDefinition).currentPage?.id;
33
+ const pageId = getService(PagesDefinition).currentPageId();
32
34
  if (!pageId) {
33
35
  return;
34
36
  }
35
37
  const { addTopComponent } = getService(ProvideComponentServiceDefinition);
36
- if (!useV2) {
37
- addTopComponent(createInteractionsScriptElement(config, isReducedMotion, pageId));
38
- return;
39
- }
40
- // Both belong in the head: the preload links only help while the document is still parsing,
41
- // and the generated CSS hides elements before their entrance effect, so it has to apply
42
- // before the body renders.
43
- const css = getV2ConfigCss(config).trim();
44
- getService(HeadAppenderDefinition).setHead(getV2ModulePreloadHeadContent(config) + (css ? getV2ConfigStyleHeadContent(css) : ''));
45
- addTopComponent(createV2InteractionsScriptElement(config, isReducedMotion, pageId));
38
+ const interactionsScript = useV2
39
+ ? createV2InteractionsScriptElement(config, isReducedMotion, pageId)
40
+ : createInteractionsScriptElement(config, isReducedMotion, pageId);
41
+ addTopComponent(interactionsScript);
46
42
  };
47
43
  const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, effects }) => {
48
44
  // add trigger comp
@@ -55,14 +51,25 @@ const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, e
55
51
  export const coreInteractions = (config, getService) => {
56
52
  const { reducedMotion: isReducedMotion } = getService(DeviceInfoDefinition);
57
53
  const { isOpen } = getService(ExperimentsDefinition);
58
- if (isOpen('specs.thunderbolt.interactionsInSsr')) {
54
+ if (isOpen('specs.thunderbolt.vsm_interactions_v2')) {
55
+ // Both belong in the head: the preload links only help while the document is still parsing,
56
+ // and the generated CSS hides elements before their entrance effect, so it has to apply
57
+ // before the body renders.
58
+ if (!process.env.browser) {
59
+ const css = getV2ConfigCss(config).trim();
60
+ // GENERAL rather than setHead's AFTER_SECURITY default: thunderbolt only reads the
61
+ // after-security bucket on its SEO path, so the default drops this on every normal
62
+ // request. GENERAL reaches the document as raw markup before `</head>`.
63
+ getService(HeadAppenderDefinition).setHead(getV2ModulePreloadHeadContent() + (css ? getV2ConfigStyleHeadContent(css) : ''), HeadContentType.GENERAL);
64
+ }
65
+ initRuntime(config, isReducedMotion, getService, true);
66
+ }
67
+ else if (isOpen('specs.thunderbolt.interactionsInSsr')) {
59
68
  // Emits the config and loader scripts. Works in both environments: SSR serves markup the
60
69
  // parser executes, and on the client the loader's ref revives it into a script that runs —
61
70
  // which is what pages rendered only on the client (password-protected / members-only,
62
71
  // client-side navigation) need, since they never get a server-rendered document.
63
- // v2 is only reachable from here: it ships as a loader script plus generated CSS, both of
64
- // which exist only on this path.
65
- initRuntime(config, isReducedMotion, getService, isOpen('specs.thunderbolt.vsm_interactions_v2'));
72
+ initRuntime(config, isReducedMotion, getService, false);
66
73
  }
67
74
  else {
68
75
  initInteract(config, isReducedMotion);
@@ -1 +1 @@
1
- {"version":3,"file":"coreInteractions.js","sourceRoot":"","sources":["../../src/implementations/coreInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AACnF,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;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,eAAwB,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AAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACzC,mFAAmF;YACnF,mFAAmF;YACnF,wEAAwE;YACxE,UAAU,CAAC,sBAAsB,CAAC,CAAC,OAAO,CACtC,6BAA6B,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/E,eAAe,CAAC,OAAO,CAC1B,CAAA;QACL,CAAC;QAED,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IAC1D,CAAC;SAAM,IAAI,MAAM,CAAC,qCAAqC,CAAC,EAAE,CAAC;QACvD,yFAAyF;QACzF,2FAA2F;QAC3F,sFAAsF;QACtF,iFAAiF;QACjF,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;IAC3D,CAAC;SAAM,CAAC;QACJ,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACzC,CAAC;IAED,OAAO;QACH,gBAAgB,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;KAC7D,CAAA;AACL,CAAC,CAAA"}
@@ -12,7 +12,7 @@ export const createV2InteractionsScriptElement = (config, isReducedMotion, pageI
12
12
  // script delimiters and template-literal syntax while keeping the ID deterministic.
13
13
  const safePageId = encodeURIComponent(pageId);
14
14
  const configId = `interactions-config-${safePageId}`;
15
- const interactionsScriptContent = getV2InteractionsScriptContent(config, configId, isReducedMotion);
15
+ const interactionsScriptContent = getV2InteractionsScriptContent(configId, isReducedMotion);
16
16
  const configProps = {
17
17
  [DANGEROUSLY_SET_INNER_HTML.join('')]: { __html: serializeConfigForScriptElement(config) },
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../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mB,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,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,2 +1,2 @@
1
- export declare const INTERACT_V2_IMPORT_URL = "https://cdn.jsdelivr.net/npm/@wix/interact@2/dist/es/web.min.js";
2
- export declare const WIX_MOTION_PRESETS_IMPORT_URL = "https://static.parastorage.com/services/wix-motion-presets/dist/wix-motion-presets.esm.min.js";
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";
@@ -1,3 +1,3 @@
1
- export const INTERACT_V2_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/interact@2/dist/es/web.min.js';
2
- export const WIX_MOTION_PRESETS_IMPORT_URL = 'https://static.parastorage.com/services/wix-motion-presets/dist/wix-motion-presets.esm.min.js';
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';
3
3
  //# 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,iEAAiE,CAAA;AAEvG,MAAM,CAAC,MAAM,6BAA6B,GACtC,+FAA+F,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,6BAA6B,GAAG,iEAAiE,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import type { InteractConfig } from '@wix/interact';
2
- /** Register config-used presets, then emit animation FOUC CSS and click-trigger cursor rules. */
2
+ /** Emit animation FOUC CSS and click-trigger cursor rules. */
3
3
  export declare const getV2ConfigCss: (config: InteractConfig) => string;
@@ -1,9 +1,11 @@
1
- import { generate } from '@wix/interact';
1
+ import { generate, Interact } from '@wix/interact-v2';
2
+ import * as motionPresets from '@wix/wix-motion-presets';
2
3
  import { getClickTriggerCss } from './clickTriggerCss';
3
- import { registerConfigEffects } from './registerConfigEffects';
4
- /** Register config-used presets, then emit animation FOUC CSS and click-trigger cursor rules. */
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.
6
+ Interact.registerEffects(motionPresets);
7
+ /** Emit animation FOUC CSS and click-trigger cursor rules. */
5
8
  export const getV2ConfigCss = (config) => {
6
- registerConfigEffects(config);
7
9
  const animationCss = generate(config, true).trim();
8
10
  const clickCss = getClickTriggerCss(config).trim();
9
11
  return [animationCss, clickCss].filter(Boolean).join('\n');
@@ -1 +1 @@
1
- {"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,iGAAiG;AACjG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAC7D,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC7B,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IAClD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC,CAAA"}
1
+ {"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAGrD,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAItD,2FAA2F;AAC3F,qFAAqF;AACrF,QAAQ,CAAC,eAAe,CAAC,aAA0C,CAAC,CAAA;AAEpE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAC7D,MAAM,YAAY,GAAG,QAAQ,CAAC,MAA0B,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IACtE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC,CAAA"}
@@ -1,9 +1,8 @@
1
- import type { InteractConfig } from '@wix/interact';
2
1
  /**
3
2
  * The loader reaches these modules through dynamic `import()`, which the preload scanner cannot
4
3
  * see, so without the links the fetches only start once the loader runs. No `crossorigin`: a bare
5
4
  * `modulepreload` fetches with the same credentials mode as a bare `import()`, and a mismatch
6
5
  * would download each module twice.
7
6
  */
8
- export declare const getV2ModulePreloadHeadContent: (config: InteractConfig) => string;
9
- export declare const getV2InteractionsScriptContent: (config: InteractConfig, configId: string, isReducedMotion: boolean) => string;
7
+ export declare const getV2ModulePreloadHeadContent: () => string;
8
+ export declare const getV2InteractionsScriptContent: (configId: string, isReducedMotion: boolean) => string;
@@ -1,47 +1,31 @@
1
1
  import { INTERACT_V2_IMPORT_URL, WIX_MOTION_PRESETS_IMPORT_URL } from './cdnUrls';
2
- import { collectNamedEffectTypes } from './namedEffectTypes';
3
- import { filterKnownPresetTypes } from './motionPresets';
4
- const getPresetTypes = (config) => filterKnownPresetTypes(collectNamedEffectTypes(config));
5
- const getModuleUrls = (presetTypes) => presetTypes.length > 0 ? [INTERACT_V2_IMPORT_URL, WIX_MOTION_PRESETS_IMPORT_URL] : [INTERACT_V2_IMPORT_URL];
6
2
  /**
7
3
  * The loader reaches these modules through dynamic `import()`, which the preload scanner cannot
8
4
  * see, so without the links the fetches only start once the loader runs. No `crossorigin`: a bare
9
5
  * `modulepreload` fetches with the same credentials mode as a bare `import()`, and a mismatch
10
6
  * would download each module twice.
11
7
  */
12
- export const getV2ModulePreloadHeadContent = (config) => getModuleUrls(getPresetTypes(config))
13
- .map(url => `<link rel="modulepreload" href="${url}">`)
14
- .join('');
15
- export const getV2InteractionsScriptContent = (config, configId, isReducedMotion) => {
16
- const presetTypes = getPresetTypes(config);
17
- const bindings = ['{ Interact }'];
18
- const imports = getModuleUrls(presetTypes).map(url => `import(\`${url}\`)`);
19
- if (presetTypes.length > 0) {
20
- bindings.push(`{ ${presetTypes.join(', ')} }`);
21
- }
22
- const registerEffects = presetTypes.length > 0 ? ` Interact.registerEffects({ ${presetTypes.join(', ')} })` : undefined;
23
- return [
24
- `const configElement = document.getElementById(\`${configId}\`)`,
25
- 'if (configElement) {',
26
- ' const config = JSON.parse(configElement.textContent)',
27
- ` const [${bindings.join(', ')}] = await Promise.all([`,
28
- ...imports.map(importCall => ` ${importCall},`),
29
- ' ])',
30
- registerEffects,
31
- ` Interact.forceReducedMotion = ${isReducedMotion}`,
32
- ' Interact.setup({',
33
- ' scrollOptionsGetter: function () {',
34
- ' return document.getElementById(`site-root`)',
35
- ' },',
36
- ' allowA11yTriggers: true,',
37
- ' viewEnter: {',
38
- ' useSafeViewEnter: true,',
39
- ' },',
40
- ' })',
41
- ' Interact.create(config)',
42
- '}',
43
- ]
44
- .filter((line) => line !== undefined)
45
- .join('\n');
46
- };
8
+ export const getV2ModulePreloadHeadContent = () => `<link rel="modulepreload" href="${INTERACT_V2_IMPORT_URL}"><link rel="modulepreload" href="${WIX_MOTION_PRESETS_IMPORT_URL}">`;
9
+ export const getV2InteractionsScriptContent = (configId, isReducedMotion) => [
10
+ `const configElement = document.getElementById(\`${configId}\`)`,
11
+ 'if (configElement) {',
12
+ ' const config = JSON.parse(configElement.textContent)',
13
+ ' const [{ Interact }, presets] = await Promise.all([',
14
+ ` import(\`${INTERACT_V2_IMPORT_URL}\`),`,
15
+ ` import(\`${WIX_MOTION_PRESETS_IMPORT_URL}\`),`,
16
+ ' ])',
17
+ ' Interact.registerEffects(presets)',
18
+ ` Interact.forceReducedMotion = ${isReducedMotion}`,
19
+ ' Interact.setup({',
20
+ ' scrollOptionsGetter: function () {',
21
+ ' return document.getElementById(`site-root`)',
22
+ ' },',
23
+ ' allowA11yTriggers: true,',
24
+ ' viewEnter: {',
25
+ ' useSafeViewEnter: true,',
26
+ ' },',
27
+ ' })',
28
+ ' Interact.create(config)',
29
+ '}',
30
+ ].join('\n');
47
31
  //# sourceMappingURL=interactionsScriptContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactionsScriptContent.js","sourceRoot":"","sources":["../../../src/implementations/v2/interactionsScriptContent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAY,EAAE,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAA;AAEpH,MAAM,aAAa,GAAG,C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ClD,MAAM;QACN,eAAe;QACf,mCAAmC,eAAe,EAAE;QACpD,oBAAoB;QACpB,wCAAwC;QACxC,mDAAmD;QACnD,QAAQ;QACR,8BAA8B;QAC9B,kBAAkB;QAClB,+BAA+B;QAC/B,QAAQ;QACR,MAAM;QACN,2BAA2B;QAC3B,GAAG;KACN;SACI,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC;SACpD,IAAI,CAAC,IAAI,CAAC,CAAA;AACnB,CAAC,CAAA"}
1
+ {"version":3,"file":"interactionsScriptContent.js","sourceRoot":"","sources":["../../../src/implementations/v2/interactionsScriptContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AAEjF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAW,EAAE,CACtD,mCAAmC,sBAAsB,qCAAqC,6BAA6B,IAAI,CAAA;AAEnI,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,QAAgB,EAAE,eAAwB,EAAU,EAAE,CACjG;IACI,mDAAmD,QAAQ,KAAK;IAChE,sBAAsB;IACtB,wDAAwD;IACxD,uDAAuD;IACvD,gBAAgB,sBAAsB,MAAM;IAC5C,gBAAgB,6BAA6B,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"}