@wix/site-service-interactions 1.0.12 → 1.0.14
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.
- package/cjs/build/definition/index.d.ts +19 -3
- package/cjs/build/definition/index.js.map +1 -1
- package/cjs/build/implementations/InteractionsScriptElement.d.ts +1 -1
- package/cjs/build/implementations/InteractionsScriptElement.js.map +1 -1
- package/cjs/build/implementations/configEntries.d.ts +13 -0
- package/cjs/build/implementations/configEntries.js +78 -0
- package/cjs/build/implementations/configEntries.js.map +1 -0
- package/cjs/build/implementations/coreInteractions.d.ts +2 -2
- package/cjs/build/implementations/coreInteractions.js +50 -23
- package/cjs/build/implementations/coreInteractions.js.map +1 -1
- package/cjs/build/implementations/interactions.js +1 -1
- package/cjs/build/implementations/interactions.js.map +1 -1
- package/cjs/build/implementations/interactionsExternal.js +1 -1
- package/cjs/build/implementations/interactionsExternal.js.map +1 -1
- package/cjs/build/implementations/interactionsService.d.ts +5 -4
- package/cjs/build/implementations/interactionsService.js.map +1 -1
- package/cjs/build/implementations/reviveScriptElement.js.map +1 -1
- package/cjs/build/implementations/v2/InteractionsScriptElement.d.ts +2 -2
- package/cjs/build/implementations/v2/InteractionsScriptElement.js.map +1 -1
- package/cjs/build/implementations/v2/authoredStyles.d.ts +2 -0
- package/cjs/build/implementations/v2/authoredStyles.js +90 -0
- package/cjs/build/implementations/v2/authoredStyles.js.map +1 -0
- package/cjs/build/implementations/v2/cdnUrls.d.ts +2 -1
- package/cjs/build/implementations/v2/cdnUrls.js +3 -2
- package/cjs/build/implementations/v2/cdnUrls.js.map +1 -1
- package/cjs/build/implementations/v2/clickTriggerCss.d.ts +1 -1
- package/cjs/build/implementations/v2/clickTriggerCss.js +1 -1
- package/cjs/build/implementations/v2/clickTriggerCss.js.map +1 -1
- package/cjs/build/implementations/v2/configCss.d.ts +1 -1
- package/cjs/build/implementations/v2/configCss.js +3 -36
- package/cjs/build/implementations/v2/configCss.js.map +1 -1
- package/cjs/build/implementations/v2/configStyleHeadContent.js +8 -6
- package/cjs/build/implementations/v2/configStyleHeadContent.js.map +1 -1
- package/cjs/build/implementations/v2/interactionsScriptContent.js +18 -7
- package/cjs/build/implementations/v2/interactionsScriptContent.js.map +1 -1
- package/cjs/build/implementations/v2/motionPresets.d.ts +14 -0
- package/cjs/build/implementations/v2/motionPresets.js +76 -0
- package/cjs/build/implementations/v2/motionPresets.js.map +1 -0
- package/cjs/build/service.d.ts +1 -1
- package/cjs/build/types/index.d.ts +1 -1
- package/cjs/package.json +1 -1
- package/definition/package.json +1 -1
- package/dist/definition/index.d.ts +19 -3
- package/dist/definition/index.js.map +1 -1
- package/dist/implementations/InteractionsScriptElement.d.ts +1 -1
- package/dist/implementations/InteractionsScriptElement.js.map +1 -1
- package/dist/implementations/configEntries.d.ts +13 -0
- package/dist/implementations/configEntries.js +71 -0
- package/dist/implementations/configEntries.js.map +1 -0
- package/dist/implementations/coreInteractions.d.ts +2 -2
- package/dist/implementations/coreInteractions.js +50 -23
- package/dist/implementations/coreInteractions.js.map +1 -1
- package/dist/implementations/interactions.js +1 -1
- package/dist/implementations/interactions.js.map +1 -1
- package/dist/implementations/interactionsExternal.js +1 -1
- package/dist/implementations/interactionsExternal.js.map +1 -1
- package/dist/implementations/interactionsService.d.ts +5 -4
- package/dist/implementations/interactionsService.js.map +1 -1
- package/dist/implementations/reviveScriptElement.js.map +1 -1
- package/dist/implementations/v2/InteractionsScriptElement.d.ts +2 -2
- package/dist/implementations/v2/InteractionsScriptElement.js.map +1 -1
- package/dist/implementations/v2/authoredStyles.d.ts +2 -0
- package/dist/implementations/v2/authoredStyles.js +86 -0
- package/dist/implementations/v2/authoredStyles.js.map +1 -0
- package/dist/implementations/v2/cdnUrls.d.ts +2 -1
- package/dist/implementations/v2/cdnUrls.js +2 -1
- package/dist/implementations/v2/cdnUrls.js.map +1 -1
- package/dist/implementations/v2/clickTriggerCss.d.ts +1 -1
- package/dist/implementations/v2/clickTriggerCss.js +1 -1
- package/dist/implementations/v2/clickTriggerCss.js.map +1 -1
- package/dist/implementations/v2/configCss.d.ts +1 -1
- package/dist/implementations/v2/configCss.js +2 -2
- package/dist/implementations/v2/configCss.js.map +1 -1
- package/dist/implementations/v2/configStyleHeadContent.js +8 -6
- package/dist/implementations/v2/configStyleHeadContent.js.map +1 -1
- package/dist/implementations/v2/interactionsScriptContent.js +19 -8
- package/dist/implementations/v2/interactionsScriptContent.js.map +1 -1
- package/dist/implementations/v2/motionPresets.d.ts +14 -0
- package/dist/implementations/v2/motionPresets.js +39 -0
- package/dist/implementations/v2/motionPresets.js.map +1 -0
- package/dist/service.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/implementations/package.json +1 -1
- package/package.json +24 -23
- package/src/definition/index.ts +21 -4
- package/src/implementations/InteractionsScriptElement.tsx +17 -17
- package/src/implementations/configEntries.ts +103 -0
- package/src/implementations/coreInteractions.ts +102 -68
- package/src/implementations/interactions.ts +8 -8
- package/src/implementations/interactionsExternal.ts +11 -11
- package/src/implementations/interactionsService.ts +8 -8
- package/src/implementations/reviveScriptElement.ts +8 -8
- package/src/implementations/v2/InteractionsScriptElement.tsx +23 -28
- package/src/implementations/v2/authoredStyles.ts +103 -0
- package/src/implementations/v2/cdnUrls.ts +4 -1
- package/src/implementations/v2/clickTriggerCss.ts +26 -26
- package/src/implementations/v2/configCss.ts +6 -7
- package/src/implementations/v2/configStyleHeadContent.ts +9 -6
- package/src/implementations/v2/interactionsScriptContent.ts +36 -24
- package/src/implementations/v2/motionPresets.ts +60 -0
- package/src/types/index.ts +1 -1
- package/types/package.json +1 -1
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getV2ConfigStyleHeadContent = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Head content is a raw HTML string
|
|
6
|
-
* style
|
|
7
|
-
*
|
|
8
|
-
* from the first `<` that could start a tag leaves valid CSS untouched.
|
|
5
|
+
* Head content is a raw HTML string. CSS values may contain tag-like text, but an actual closing
|
|
6
|
+
* style tag still terminates the raw-text element, and HeadAppender rejects `<script` substrings.
|
|
7
|
+
* Keep other CSS intact: drop content after a closing style tag and break script-like sequences.
|
|
9
8
|
*/
|
|
9
|
+
const STYLE_END_TAG = /<\/style(?=[\t\n\f\r />])/i;
|
|
10
|
+
const SCRIPT_LIKE = /<script/gi;
|
|
10
11
|
const sanitizeCssForStyleElement = (css) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
12
|
+
const styleEndTagIndex = css.search(STYLE_END_TAG);
|
|
13
|
+
const withoutStyleBreakout = styleEndTagIndex === -1 ? css : css.slice(0, styleEndTagIndex);
|
|
14
|
+
return withoutStyleBreakout.replace(SCRIPT_LIKE, '\\3c script');
|
|
13
15
|
};
|
|
14
16
|
const getV2ConfigStyleHeadContent = (css) => `<style>${sanitizeCssForStyleElement(css)}</style>`;
|
|
15
17
|
exports.getV2ConfigStyleHeadContent = getV2ConfigStyleHeadContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configStyleHeadContent.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configStyleHeadContent.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"configStyleHeadContent.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configStyleHeadContent.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAM,aAAa,GAAG,4BAA4B,CAAA;AAClD,MAAM,WAAW,GAAG,WAAW,CAAA;AAE/B,MAAM,0BAA0B,GAAG,CAAC,GAAW,EAAU,EAAE;IAC1D,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAClD,MAAM,oBAAoB,GAAG,gBAAgB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAA;IAC3F,OAAO,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AAChE,CAAC,CAAA;AAEM,MAAM,2BAA2B,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,UAAU,0BAA0B,CAAC,GAAG,CAAC,UAAU,CAAA;AAA1G,QAAA,2BAA2B,+BAA+E"}
|
|
@@ -2,23 +2,32 @@
|
|
|
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 motionPresets_1 = require("./motionPresets");
|
|
6
|
+
/** The loader destructures `Promise.all` in this order. */
|
|
7
|
+
const MODULE_IMPORT_URLS = [cdnUrls_1.INTERACT_V2_IMPORT_URL, cdnUrls_1.LEGACY_WIX_MOTION_PRESETS_IMPORT_URL, cdnUrls_1.MOTION_PRESETS_IMPORT_URL];
|
|
5
8
|
/**
|
|
6
9
|
* The loader reaches these modules through dynamic `import()`, which the preload scanner cannot
|
|
7
10
|
* see, so without the links the fetches only start once the loader runs. No `crossorigin`: a bare
|
|
8
11
|
* `modulepreload` fetches with the same credentials mode as a bare `import()`, and a mismatch
|
|
9
12
|
* would download each module twice.
|
|
10
13
|
*/
|
|
11
|
-
const getV2ModulePreloadHeadContent = () => `<link rel="modulepreload" href="${
|
|
14
|
+
const getV2ModulePreloadHeadContent = () => MODULE_IMPORT_URLS.map((url) => `<link rel="modulepreload" href="${url}">`).join('');
|
|
12
15
|
exports.getV2ModulePreloadHeadContent = getV2ModulePreloadHeadContent;
|
|
13
16
|
const getV2InteractionsScriptContent = (configId, isReducedMotion) => [
|
|
14
17
|
`const configElement = document.getElementById(\`${configId}\`)`,
|
|
15
18
|
'if (configElement) {',
|
|
16
|
-
' const
|
|
17
|
-
' const
|
|
18
|
-
|
|
19
|
-
` import(\`${
|
|
19
|
+
' const parsedConfig = JSON.parse(configElement.textContent)',
|
|
20
|
+
' const configs = Array.isArray(parsedConfig) ? parsedConfig : [parsedConfig]',
|
|
21
|
+
' const [{ Interact }, legacyPresets, presets] = await Promise.all([',
|
|
22
|
+
...MODULE_IMPORT_URLS.map((url) => ` import(\`${url}\`),`),
|
|
20
23
|
' ])',
|
|
21
|
-
|
|
24
|
+
// Reactions configs carry the prefix on their named effect types, so the two packages can
|
|
25
|
+
// both export a preset under the same name without one shadowing the other.
|
|
26
|
+
' const aliasedLegacyPresets = {}',
|
|
27
|
+
' for (const name of Object.keys(legacyPresets)) {',
|
|
28
|
+
` aliasedLegacyPresets[\`${motionPresets_1.LEGACY_PREFIX}\` + name] = legacyPresets[name]`,
|
|
29
|
+
' }',
|
|
30
|
+
' Interact.registerEffects({ ...presets, ...aliasedLegacyPresets })',
|
|
22
31
|
` Interact.forceReducedMotion = ${isReducedMotion}`,
|
|
23
32
|
' Interact.setup({',
|
|
24
33
|
' scrollOptionsGetter: function () {',
|
|
@@ -29,7 +38,9 @@ const getV2InteractionsScriptContent = (configId, isReducedMotion) => [
|
|
|
29
38
|
' useSafeViewEnter: true,',
|
|
30
39
|
' },',
|
|
31
40
|
' })',
|
|
32
|
-
'
|
|
41
|
+
' for (const config of configs) {',
|
|
42
|
+
' Interact.create(config)',
|
|
43
|
+
' }',
|
|
33
44
|
'}',
|
|
34
45
|
].join('\n');
|
|
35
46
|
exports.getV2InteractionsScriptContent = getV2InteractionsScriptContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsScriptContent.js","sourceRoot":"","sources":["../../../../src/implementations/v2/interactionsScriptContent.ts"],"names":[],"mappings":";;;AAAA,
|
|
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,CACzD,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AADxE,QAAA,6BAA6B,iCAC2C;AAE9E,MAAM,8BAA8B,GAAG,CAAC,QAAgB,EAAE,eAAwB,EAAU,EAAE,CACpG;IACC,mDAAmD,QAAQ,KAAK;IAChE,sBAAsB;IACtB,8DAA8D;IAC9D,+EAA+E;IAC/E,sEAAsE;IACtE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,GAAG,MAAM,CAAC;IAC7D,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;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AA9BA,QAAA,8BAA8B,kCA8B9B"}
|
|
@@ -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,QAAA,aAAa,GAAG,SAAS,CAAA;AAEtC,MAAM,cAAc,GAAG,CAAC,KAAc,EAAyB,EAAE,CAChE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,CAAA;AAErF,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAgC,EAAE,CACjG,MAAM,CAAC,WAAW,CACjB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;KACvB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAC5C,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,EAAE,KAAqB,CAAC,CAAC,CACrE,CAAA;AAEF;;;GAGG;AACU,QAAA,aAAa,GAAiC;IAC1D,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAC/B,GAAG,gB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CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC;IACtF,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACzD,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;KACrF,CAAC,CAAC;CACH,CAAC,CAAA;AATW,QAAA,uBAAuB,2BASlC"}
|
package/cjs/build/service.d.ts
CHANGED
|
@@ -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("
|
|
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';
|
package/cjs/package.json
CHANGED
package/definition/package.json
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import type { StaticServiceDefinition } from '@wix/static-service';
|
|
2
|
-
import type { InteractConfig } from '@wix/interact';
|
|
3
|
-
export type
|
|
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:
|
|
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;
|
|
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,CACxD,gCAAgC,CAChC,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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../src/implementations/InteractionsScriptElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,CAAC,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../src/implementations/InteractionsScriptElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,CAAC,MAAM,+BAA+B,GAC3C,CAAC,MAAsB,EAAE,eAAwB,EAAE,MAAc,EAAqB,EAAE,CACxF,GAAG,EAAE;IACJ,MAAM,QAAQ,GAAG,uBAAuB,MAAM,EAAE,CAAA;IAChD,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;IAEzF,OAAO,CACN;QACC,gCAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,IAC1C,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CACnC;QAGT,gCAAQ,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAE,uBAAuB,MAAM,EAAE,EAAE,GAAG,EAAE,mBAAmB,IACjF,yBAAyB,CAClB,CACP,CACH,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -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,71 @@
|
|
|
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 ? { ...entry, interact: aliasLegacyNamedEffects(entry.interact) } : entry);
|
|
5
|
+
/** An `effectId` points at `interact.effects`, which is where a reactions effect keeps its key. */
|
|
6
|
+
const resolveEffectKey = (interact, effect) => effect.key ?? (effect.effectId ? interact.effects?.[effect.effectId]?.key : undefined);
|
|
7
|
+
const addEffectKeys = (keys, interact, effects = []) => {
|
|
8
|
+
for (const effect of effects) {
|
|
9
|
+
const key = resolveEffectKey(interact, effect);
|
|
10
|
+
if (key) {
|
|
11
|
+
keys.add(key);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** A `sequenceId` reference has no inline effects; resolve it against `interact.sequences`. */
|
|
16
|
+
const getSequenceEffects = (interact, sequence) => 'effects' in sequence ? sequence.effects : (interact.sequences?.[sequence.sequenceId]?.effects ?? []);
|
|
17
|
+
const getInteractionKeys = (interact, interaction) => {
|
|
18
|
+
const keys = new Set([interaction.key]);
|
|
19
|
+
addEffectKeys(keys, interact, interaction.effects);
|
|
20
|
+
for (const sequence of interaction.sequences ?? []) {
|
|
21
|
+
addEffectKeys(keys, interact, getSequenceEffects(interact, sequence));
|
|
22
|
+
}
|
|
23
|
+
return keys;
|
|
24
|
+
};
|
|
25
|
+
export const getInteractiveKeys = ({ interact }) => {
|
|
26
|
+
const keys = new Set();
|
|
27
|
+
for (const interaction of interact.interactions) {
|
|
28
|
+
getInteractionKeys(interact, interaction).forEach((key) => keys.add(key));
|
|
29
|
+
}
|
|
30
|
+
return keys;
|
|
31
|
+
};
|
|
32
|
+
const dropOverriddenKeys = (entry, overriddenKeys) => {
|
|
33
|
+
const { interact } = entry;
|
|
34
|
+
return {
|
|
35
|
+
...entry,
|
|
36
|
+
interact: {
|
|
37
|
+
...interact,
|
|
38
|
+
interactions: interact.interactions.filter((interaction) => ![...getInteractionKeys(interact, interaction)].some((key) => overriddenKeys.has(key))),
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Interact resolves a custom-element key to the first instance containing that key, so a key shared
|
|
44
|
+
* by two entries would silently drop one of them. Experience entries own the keys they declare:
|
|
45
|
+
* whatever they claim is stripped from the reactions entry by dropping whole interactions whose
|
|
46
|
+
* resolved keys overlap. Top-level effect and sequence libraries are left intact. A collision between two
|
|
47
|
+
* experience entries stays an error, since neither of them is authoritative.
|
|
48
|
+
*/
|
|
49
|
+
export const resolveInteractKeyConflicts = (entries) => {
|
|
50
|
+
const owners = new Map();
|
|
51
|
+
entries.forEach((entry, index) => {
|
|
52
|
+
if (entry.namespace === REACTIONS_NAMESPACE) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const owner = entry.namespace ?? `entry-${index}`;
|
|
56
|
+
for (const key of getInteractiveKeys(entry)) {
|
|
57
|
+
const existingOwner = owners.get(key);
|
|
58
|
+
if (existingOwner !== undefined) {
|
|
59
|
+
throw new Error(`Interactions config key "${key}" is shared by "${existingOwner}" and "${owner}". ` +
|
|
60
|
+
'Keys must be unique across config entries.');
|
|
61
|
+
}
|
|
62
|
+
owners.set(key, owner);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
if (!owners.size) {
|
|
66
|
+
return entries;
|
|
67
|
+
}
|
|
68
|
+
const overriddenKeys = new Set(owners.keys());
|
|
69
|
+
return entries.map((entry) => entry.namespace === REACTIONS_NAMESPACE ? dropOverriddenKeys(entry, overriddenKeys) : entry);
|
|
70
|
+
};
|
|
71
|
+
//# 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,CACrG,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAA;AAE9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAkC,EAAyB,EAAE,CACrG,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9C,KAAK,CAAC,SAAS,KAAK,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CACjH,CAAA;AAEF,mGAAmG;AACnG,MAAM,gBAAgB,GAAG,CAAC,QAAwB,EAAE,MAAmB,EAAsB,EAAE,CAC9F,MAA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AM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACrC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CACd,4BAA4B,GAAG,mBAAmB,aAAa,UAAU,KAAK,KAAK;oBAClF,4CAA4C,CAC7C,CAAA;YACF,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACvB,CAAC;IACF,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,OAAO,CAAA;IACf,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5B,KAAK,CAAC,SAAS,KAAK,mBAAmB,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAC3F,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InteractConfig } from '@wix/interact';
|
|
2
1
|
import type { ServicesManager } from '@wix/services-manager/types';
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 = (
|
|
30
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
88
|
+
if (headContent) {
|
|
89
|
+
getService(HeadAppenderDefinition).setHead(headContent, HeadContentType.GENERAL);
|
|
90
|
+
}
|
|
64
91
|
}
|
|
65
|
-
initRuntime(
|
|
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(
|
|
99
|
+
initRuntime(entries, isReducedMotion, getService, false);
|
|
73
100
|
}
|
|
74
101
|
else {
|
|
75
|
-
initInteract(
|
|
102
|
+
initInteract(entries, isReducedMotion);
|
|
76
103
|
}
|
|
77
104
|
return {
|
|
78
|
-
interactiveComps: getInteractiveComps(
|
|
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,EA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AAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;IACzD,CAAC;SAAM,CAAC;QACP,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;IACvC,CAAC;IAED,OAAO;QACN,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC;KAC9C,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { coreInteractions } from './coreInteractions';
|
|
|
2
2
|
export const createInteractions = (config, getService) => {
|
|
3
3
|
const { interactiveComps } = coreInteractions(config, getService);
|
|
4
4
|
const getConfigPath = (path) => path.replace(/\[[^\]]+]/g, '[]');
|
|
5
|
-
const hasInteractions = path => interactiveComps.has(getConfigPath(path));
|
|
5
|
+
const hasInteractions = (path) => interactiveComps.has(getConfigPath(path));
|
|
6
6
|
return {
|
|
7
7
|
hasInteractions,
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/implementations/interactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/implementations/interactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,MAAkC,EAClC,UAAyC,EAClB,EAAE;IACzB,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEjE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;IAExE,MAAM,eAAe,GAA4C,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;IAEpH,OAAO;QACN,eAAe;KACf,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -7,7 +7,7 @@ export const createInteractionsExternal = (config, getService) => {
|
|
|
7
7
|
const cssToAdd = styles.join('\n');
|
|
8
8
|
provideCssService.addStyle(cssToAdd);
|
|
9
9
|
const { interactiveComps } = coreInteractions(config, getService);
|
|
10
|
-
const hasInteractions = path => interactiveComps.has(path);
|
|
10
|
+
const hasInteractions = (path) => interactiveComps.has(path);
|
|
11
11
|
return {
|
|
12
12
|
hasInteractions,
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsExternal.js","sourceRoot":"","sources":["../../src/implementations/interactionsExternal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEzE,MAAM,CAAC,MAAM,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"file":"interactionsExternal.js","sourceRoot":"","sources":["../../src/implementations/interactionsExternal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEzE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACzC,MAAkC,EAClC,UAAyC,EAClB,EAAE;IACzB,MAAM,iBAAiB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;IAE1D,MAAM,MAAM,GAAG,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAA;IAC1D,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAElC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAEpC,MAAM,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAEjE,MAAM,eAAe,GAA4C,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAErG,OAAO;QACN,eAAe;KACf,CAAA;AACF,CAAC,CAAA"}
|
|
@@ -1,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:
|
|
4
|
+
__config: IInteractionsServiceConfig;
|
|
4
5
|
isServiceDefinition?: boolean;
|
|
5
|
-
} & import("..").IInteractionsService,
|
|
6
|
+
} & import("..").IInteractionsService, IInteractionsServiceConfig>;
|
|
6
7
|
export declare const InteractionsServiceExternal: import("@wix/services-definitions").ServiceFactory<string & {
|
|
7
8
|
__api: import("..").IInteractionsService;
|
|
8
|
-
__config:
|
|
9
|
+
__config: IInteractionsServiceConfig;
|
|
9
10
|
isServiceDefinition?: boolean;
|
|
10
|
-
} & import("..").IInteractionsService,
|
|
11
|
+
} & import("..").IInteractionsService, IInteractionsServiceConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsService.js","sourceRoot":"","sources":["../../src/implementations/interactionsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"interactionsService.js","sourceRoot":"","sources":["../../src/implementations/interactionsService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAEnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CACxD,sBAAsB,EACtB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAwD,EAAE,EAAE;IAChF,OAAO,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAC9C,CAAC,CACD,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAChE,sBAAsB,EACtB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAwD,EAAE,EAAE;IAChF,OAAO,0BAA0B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AACtD,CAAC,CACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviveScriptElement.js","sourceRoot":"","sources":["../../src/implementations/reviveScriptElement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAkC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"reviveScriptElement.js","sourceRoot":"","sources":["../../src/implementations/reviveScriptElement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAkC,EAAE,EAAE;IACzE,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;QAC5B,OAAM;IACP,CAAC;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC9D,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;IAC/B,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAA;IAC3B,UAAU,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAA;IAE7C,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;AACjC,CAAC,CAAA"}
|
|
@@ -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,
|
|
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,K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