@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
|
@@ -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,wDAAyD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyD;AA6B5C,QAAA,sBAAsB,GAAG,IAAA,oCAAmB,EACxD,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,kDAAyB;AAGzB,2EAA0E;AAC1E,+DAA2D;AAEpD,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../src/implementations/InteractionsScriptElement.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAGzB,2EAA0E;AAC1E,+DAA2D;AAEpD,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,IAAA,wDAA4B,EAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;IAEzF,OAAO,CACN;QACC,0CAAQ,IAAI,EAAC,kBAAkB,EAAC,EAAE,EAAE,QAAQ,IAC1C,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CACnC;QAGT,0CAAQ,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAE,uBAAuB,MAAM,EAAE,EAAE,GAAG,EAAE,yCAAmB,IACjF,yBAAyB,CAClB,CACP,CACH,CAAA;AACF,CAAC,CAAA;AAlBW,QAAA,+BAA+B,mCAkB1C"}
|
|
@@ -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,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveInteractKeyConflicts = exports.getInteractiveKeys = exports.getResolvedConfigEntries = exports.getInteractConfigEntries = exports.REACTIONS_NAMESPACE = void 0;
|
|
4
|
+
const motionPresets_1 = require("./v2/motionPresets");
|
|
5
|
+
exports.REACTIONS_NAMESPACE = 'reactions';
|
|
6
|
+
const getInteractConfigEntries = (config) => 'entries' in config ? config.entries : [{ interact: config, namespace: exports.REACTIONS_NAMESPACE }];
|
|
7
|
+
exports.getInteractConfigEntries = getInteractConfigEntries;
|
|
8
|
+
const getResolvedConfigEntries = (config) => (0, exports.getInteractConfigEntries)(config).map((entry) => entry.namespace === exports.REACTIONS_NAMESPACE ? { ...entry, interact: (0, motionPresets_1.aliasLegacyNamedEffects)(entry.interact) } : entry);
|
|
9
|
+
exports.getResolvedConfigEntries = getResolvedConfigEntries;
|
|
10
|
+
/** An `effectId` points at `interact.effects`, which is where a reactions effect keeps its key. */
|
|
11
|
+
const resolveEffectKey = (interact, effect) => effect.key ?? (effect.effectId ? interact.effects?.[effect.effectId]?.key : undefined);
|
|
12
|
+
const addEffectKeys = (keys, interact, effects = []) => {
|
|
13
|
+
for (const effect of effects) {
|
|
14
|
+
const key = resolveEffectKey(interact, effect);
|
|
15
|
+
if (key) {
|
|
16
|
+
keys.add(key);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** A `sequenceId` reference has no inline effects; resolve it against `interact.sequences`. */
|
|
21
|
+
const getSequenceEffects = (interact, sequence) => 'effects' in sequence ? sequence.effects : (interact.sequences?.[sequence.sequenceId]?.effects ?? []);
|
|
22
|
+
const getInteractionKeys = (interact, interaction) => {
|
|
23
|
+
const keys = new Set([interaction.key]);
|
|
24
|
+
addEffectKeys(keys, interact, interaction.effects);
|
|
25
|
+
for (const sequence of interaction.sequences ?? []) {
|
|
26
|
+
addEffectKeys(keys, interact, getSequenceEffects(interact, sequence));
|
|
27
|
+
}
|
|
28
|
+
return keys;
|
|
29
|
+
};
|
|
30
|
+
const getInteractiveKeys = ({ interact }) => {
|
|
31
|
+
const keys = new Set();
|
|
32
|
+
for (const interaction of interact.interactions) {
|
|
33
|
+
getInteractionKeys(interact, interaction).forEach((key) => keys.add(key));
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
};
|
|
37
|
+
exports.getInteractiveKeys = getInteractiveKeys;
|
|
38
|
+
const dropOverriddenKeys = (entry, overriddenKeys) => {
|
|
39
|
+
const { interact } = entry;
|
|
40
|
+
return {
|
|
41
|
+
...entry,
|
|
42
|
+
interact: {
|
|
43
|
+
...interact,
|
|
44
|
+
interactions: interact.interactions.filter((interaction) => ![...getInteractionKeys(interact, interaction)].some((key) => overriddenKeys.has(key))),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Interact resolves a custom-element key to the first instance containing that key, so a key shared
|
|
50
|
+
* by two entries would silently drop one of them. Experience entries own the keys they declare:
|
|
51
|
+
* whatever they claim is stripped from the reactions entry by dropping whole interactions whose
|
|
52
|
+
* resolved keys overlap. Top-level effect and sequence libraries are left intact. A collision between two
|
|
53
|
+
* experience entries stays an error, since neither of them is authoritative.
|
|
54
|
+
*/
|
|
55
|
+
const resolveInteractKeyConflicts = (entries) => {
|
|
56
|
+
const owners = new Map();
|
|
57
|
+
entries.forEach((entry, index) => {
|
|
58
|
+
if (entry.namespace === exports.REACTIONS_NAMESPACE) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const owner = entry.namespace ?? `entry-${index}`;
|
|
62
|
+
for (const key of (0, exports.getInteractiveKeys)(entry)) {
|
|
63
|
+
const existingOwner = owners.get(key);
|
|
64
|
+
if (existingOwner !== undefined) {
|
|
65
|
+
throw new Error(`Interactions config key "${key}" is shared by "${existingOwner}" and "${owner}". ` +
|
|
66
|
+
'Keys must be unique across config entries.');
|
|
67
|
+
}
|
|
68
|
+
owners.set(key, owner);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
if (!owners.size) {
|
|
72
|
+
return entries;
|
|
73
|
+
}
|
|
74
|
+
const overriddenKeys = new Set(owners.keys());
|
|
75
|
+
return entries.map((entry) => entry.namespace === exports.REACTIONS_NAMESPACE ? dropOverriddenKeys(entry, overriddenKeys) : entry);
|
|
76
|
+
};
|
|
77
|
+
exports.resolveInteractKeyConflicts = resolveInteractKeyConflicts;
|
|
78
|
+
//# sourceMappingURL=configEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configEntries.js","sourceRoot":"","sources":["../../../src/implementations/configEntries.ts"],"names":[],"mappings":";;;AACA,sDAA4D;AAE/C,QAAA,mBAAmB,GAAG,WAAW,CAAA;AAMvC,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,2BAAmB,EAAE,CAAC,CAAA;AADjF,QAAA,wBAAwB,4BACyD;AAEvF,MAAM,wBAAwB,GAAG,CAAC,MAAkC,EAAyB,EAAE,CACrG,IAAA,gCAAwB,EAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC9C,KAAK,CAAC,SAAS,KAAK,2BAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAA,uCAAuB,EAAC,KAAK,CAA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AAE,CAAC;YAC7C,OAAM;QACP,CAAC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,IAAI,SAAS,KAAK,EAAE,CAAA;QACjD,KAAK,MAAM,GAAG,IAAI,IAAA,0BAAkB,EAAC,KAAK,CAAC,EAAE,CAAC;YAC7C,MAAM,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,2BAAmB,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAC3F,CAAA;AACF,CAAC,CAAA;AA5BY,QAAA,2BAA2B,+BA4BvC"}
|
|
@@ -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
|
};
|
|
@@ -17,7 +17,11 @@ const InteractionsScriptElement_2 = require("./v2/InteractionsScriptElement");
|
|
|
17
17
|
const configCss_1 = require("./v2/configCss");
|
|
18
18
|
const configStyleHeadContent_1 = require("./v2/configStyleHeadContent");
|
|
19
19
|
const interactionsScriptContent_1 = require("./v2/interactionsScriptContent");
|
|
20
|
-
const
|
|
20
|
+
const authoredStyles_1 = require("./v2/authoredStyles");
|
|
21
|
+
const configEntries_1 = require("./configEntries");
|
|
22
|
+
/** An entry without interactions contributes CSS only; nothing has to load Interact for it. */
|
|
23
|
+
const getRuntimeConfigs = (entries) => entries.map(({ interact }) => interact).filter(({ interactions }) => interactions.length > 0);
|
|
24
|
+
const initInteract = (entries, isReducedMotion) => {
|
|
21
25
|
// Bundled runtime is v1. v2 on the client is the CDN loader.
|
|
22
26
|
interact_1.Interact.forceReducedMotion = isReducedMotion;
|
|
23
27
|
interact_1.Interact.setup({
|
|
@@ -27,10 +31,22 @@ const initInteract = (config, isReducedMotion) => {
|
|
|
27
31
|
useSafeViewEnter: true,
|
|
28
32
|
},
|
|
29
33
|
});
|
|
30
|
-
|
|
34
|
+
for (const { interact } of entries) {
|
|
35
|
+
interact_1.Interact.create(interact);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getV2HeadContent = (entries) => {
|
|
39
|
+
const generatedCss = entries
|
|
40
|
+
.map(({ interact }) => (0, configCss_1.getV2ConfigCss)(interact).trim())
|
|
41
|
+
.filter(Boolean)
|
|
42
|
+
.join('\n');
|
|
43
|
+
const css = [(0, authoredStyles_1.getAuthoredStylesCss)(entries).trim(), generatedCss].filter(Boolean).join('\n');
|
|
44
|
+
return ((getRuntimeConfigs(entries).length ? (0, interactionsScriptContent_1.getV2ModulePreloadHeadContent)() : '') +
|
|
45
|
+
(css ? (0, configStyleHeadContent_1.getV2ConfigStyleHeadContent)(css) : ''));
|
|
31
46
|
};
|
|
32
|
-
const initRuntime = (
|
|
33
|
-
|
|
47
|
+
const initRuntime = (entries, isReducedMotion, getService, useV2) => {
|
|
48
|
+
const runtimeConfigs = getRuntimeConfigs(entries);
|
|
49
|
+
if (!runtimeConfigs.length) {
|
|
34
50
|
return;
|
|
35
51
|
}
|
|
36
52
|
const pageId = getService(definition_3.PagesDefinition).currentPageId();
|
|
@@ -38,47 +54,58 @@ const initRuntime = (config, isReducedMotion, getService, useV2) => {
|
|
|
38
54
|
return;
|
|
39
55
|
}
|
|
40
56
|
const { addTopComponent } = getService(provide_component_1.ProvideComponentServiceDefinition);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
if (!useV2) {
|
|
58
|
+
// v1 serializes a single config and has no path for authored-style CSS, so anything beyond
|
|
59
|
+
// that would be silently dropped.
|
|
60
|
+
if (entries.length > 1 || entries.some(({ styles }) => styles?.length)) {
|
|
61
|
+
throw new Error('Multiple interactions config entries and authored styles require Interact v2.');
|
|
62
|
+
}
|
|
63
|
+
addTopComponent((0, InteractionsScriptElement_1.createInteractionsScriptElement)(runtimeConfigs[0], isReducedMotion, pageId));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
addTopComponent((0, InteractionsScriptElement_2.createV2InteractionsScriptElement)(runtimeConfigs, isReducedMotion, pageId));
|
|
67
|
+
};
|
|
68
|
+
const getInteractiveComps = (entries) => {
|
|
69
|
+
const keys = new Set();
|
|
70
|
+
for (const entry of entries) {
|
|
71
|
+
(0, configEntries_1.getInteractiveKeys)(entry).forEach((key) => keys.add(key));
|
|
72
|
+
}
|
|
73
|
+
return keys;
|
|
45
74
|
};
|
|
46
|
-
const getInteractiveComps = (interactions) => interactions.reduce((acc, { key, effects }) => {
|
|
47
|
-
// add trigger comp
|
|
48
|
-
acc.add(key);
|
|
49
|
-
// add reaction comps
|
|
50
|
-
// there must be a key
|
|
51
|
-
effects?.forEach(({ key }) => acc.add(key));
|
|
52
|
-
return acc;
|
|
53
|
-
}, new Set());
|
|
54
75
|
const coreInteractions = (config, getService) => {
|
|
55
76
|
const { reducedMotion: isReducedMotion } = getService(definition_1.DeviceInfoDefinition);
|
|
56
77
|
const { isOpen } = getService(definition_2.ExperimentsDefinition);
|
|
57
|
-
|
|
78
|
+
const useV2 = isOpen('specs.thunderbolt.vsm_interactions_v2');
|
|
79
|
+
// The v1 runtime has no preset registration and doesn't understand LEGACY_* names; skip
|
|
80
|
+
// aliasing on those paths so named reaction effects remain resolvable.
|
|
81
|
+
const entries = (0, configEntries_1.resolveInteractKeyConflicts)((useV2 ? configEntries_1.getResolvedConfigEntries : configEntries_1.getInteractConfigEntries)(config));
|
|
82
|
+
if (useV2) {
|
|
58
83
|
// Both belong in the head: the preload links only help while the document is still parsing,
|
|
59
84
|
// and the generated CSS hides elements before their entrance effect, so it has to apply
|
|
60
85
|
// before the body renders.
|
|
61
86
|
if (!process.env.browser) {
|
|
62
|
-
const
|
|
87
|
+
const headContent = getV2HeadContent(entries);
|
|
63
88
|
// GENERAL rather than setHead's AFTER_SECURITY default: thunderbolt only reads the
|
|
64
89
|
// after-security bucket on its SEO path, so the default drops this on every normal
|
|
65
90
|
// request. GENERAL reaches the document as raw markup before `</head>`.
|
|
66
|
-
|
|
91
|
+
if (headContent) {
|
|
92
|
+
getService(definition_4.HeadAppenderDefinition).setHead(headContent, types_1.HeadContentType.GENERAL);
|
|
93
|
+
}
|
|
67
94
|
}
|
|
68
|
-
initRuntime(
|
|
95
|
+
initRuntime(entries, isReducedMotion, getService, true);
|
|
69
96
|
}
|
|
70
97
|
else if (isOpen('specs.thunderbolt.interactionsInSsr')) {
|
|
71
98
|
// Emits the config and loader scripts. Works in both environments: SSR serves markup the
|
|
72
99
|
// parser executes, and on the client the loader's ref revives it into a script that runs —
|
|
73
100
|
// which is what pages rendered only on the client (password-protected / members-only,
|
|
74
101
|
// client-side navigation) need, since they never get a server-rendered document.
|
|
75
|
-
initRuntime(
|
|
102
|
+
initRuntime(entries, isReducedMotion, getService, false);
|
|
76
103
|
}
|
|
77
104
|
else {
|
|
78
|
-
initInteract(
|
|
105
|
+
initInteract(entries, isReducedMotion);
|
|
79
106
|
}
|
|
80
107
|
return {
|
|
81
|
-
interactiveComps: getInteractiveComps(
|
|
108
|
+
interactiveComps: getInteractiveComps(entries),
|
|
82
109
|
};
|
|
83
110
|
};
|
|
84
111
|
exports.coreInteractions = coreInteractions;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAG/G,2EAA6E;AAC7E,8EAAkF;AAClF,8CAA+C;AAC/C,wEAAyE;AACzE,8EAA8E;AAC9E,wDAA0D;AAC1D,mDAKwB;AAExB,+FAA+F;AAC/F,MAAM,iBAAiB,GAAG,CAAC,OAA8B,EAAoB,EAAE,CAC9E,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAE9F,MAAM,YAAY,GAAG,CAAC,OAA8B,EAAE,eAAwB,EAAE,EAAE;IACjF,6DAA6D;IAC7D,mBAAQ,CAAC,kBAAkB,GAAG,eAAe,CAAA;IAC7C,mBAAQ,CAAC,KAAK,CAAC;QACd,mBAAmB,EAAE,GAAG,EAAE,CAAC,UAAU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AAK,GAAG,MAAM,CAAC,uCAAuC,CAAC,CAAA;IAC7D,wFAAwF;IACxF,uEAAuE;IACvE,MAAM,OAAO,GAAG,IAAA,2CAA2B,EAAC,CAAC,KAAK,CAAC,CAAC,CAAC,wCAAwB,CAAC,CAAC,CAAC,wCAAwB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAElH,IAAI,KAAK,EAAE,CAAC;QACX,4FAA4F;QAC5F,wFAAwF;QACxF,2BAA2B;QAC3B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAC1B,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;YAC7C,mFAAmF;YACnF,mFAAmF;YACnF,wEAAwE;YACxE,IAAI,WAAW,EAAE,CAAC;gBACjB,UAAU,CAAC,mCAAsB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,uBAAe,CAAC,OAAO,CAAC,CAAA;YACjF,CAAC;QACF,CAAC;QAED,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IACxD,CAAC;SAAM,IAAI,MAAM,CAAC,qCAAqC,CAAC,EAAE,CAAC;QAC1D,yFAAyF;QACzF,2FAA2F;QAC3F,sFAAsF;QACtF,iFAAiF;QACjF,WAAW,CAAC,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;AApCY,QAAA,gBAAgB,oBAoC5B"}
|
|
@@ -5,7 +5,7 @@ const coreInteractions_1 = require("./coreInteractions");
|
|
|
5
5
|
const createInteractions = (config, getService) => {
|
|
6
6
|
const { interactiveComps } = (0, coreInteractions_1.coreInteractions)(config, getService);
|
|
7
7
|
const getConfigPath = (path) => path.replace(/\[[^\]]+]/g, '[]');
|
|
8
|
-
const hasInteractions = path => interactiveComps.has(getConfigPath(path));
|
|
8
|
+
const hasInteractions = (path) => interactiveComps.has(getConfigPath(path));
|
|
9
9
|
return {
|
|
10
10
|
hasInteractions,
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/implementations/interactions.ts"],"names":[],"mappings":";;;AAEA,yDAAqD;AAE9C,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../../src/implementations/interactions.ts"],"names":[],"mappings":";;;AAEA,yDAAqD;AAE9C,MAAM,kBAAkB,GAAG,CACjC,MAAkC,EAClC,UAAyC,EAClB,EAAE;IACzB,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,mCAAgB,EAAC,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;AAbY,QAAA,kBAAkB,sBAa9B"}
|
|
@@ -10,7 +10,7 @@ const createInteractionsExternal = (config, getService) => {
|
|
|
10
10
|
const cssToAdd = styles.join('\n');
|
|
11
11
|
provideCssService.addStyle(cssToAdd);
|
|
12
12
|
const { interactiveComps } = (0, coreInteractions_1.coreInteractions)(config, getService);
|
|
13
|
-
const hasInteractions = path => interactiveComps.has(path);
|
|
13
|
+
const hasInteractions = (path) => interactiveComps.has(path);
|
|
14
14
|
return {
|
|
15
15
|
hasInteractions,
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsExternal.js","sourceRoot":"","sources":["../../../src/implementations/interactionsExternal.ts"],"names":[],"mappings":";;;AAAA,yEAA+E;AAG/E,yDAAqD;AACrD,+CAAyE;AAElE,MAAM,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"file":"interactionsExternal.js","sourceRoot":"","sources":["../../../src/implementations/interactionsExternal.ts"],"names":[],"mappings":";;;AAAA,yEAA+E;AAG/E,yDAAqD;AACrD,+CAAyE;AAElE,MAAM,0BAA0B,GAAG,CACzC,MAAkC,EAClC,UAAyC,EAClB,EAAE;IACzB,MAAM,iBAAiB,GAAG,UAAU,CAAC,iCAAoB,CAAC,CAAA;IAE1D,MAAM,MAAM,GAAG,CAAC,mCAAqB,EAAE,gCAAkB,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,IAAA,mCAAgB,EAAC,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;AAlBY,QAAA,0BAA0B,8BAkBtC"}
|
|
@@ -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("../definition").IInteractionsService;
|
|
3
|
-
__config:
|
|
4
|
+
__config: IInteractionsServiceConfig;
|
|
4
5
|
isServiceDefinition?: boolean;
|
|
5
|
-
} & import("../definition").IInteractionsService,
|
|
6
|
+
} & import("../definition").IInteractionsService, IInteractionsServiceConfig>;
|
|
6
7
|
export declare const InteractionsServiceExternal: import("@wix/services-definitions").ServiceFactory<string & {
|
|
7
8
|
__api: import("../definition").IInteractionsService;
|
|
8
|
-
__config:
|
|
9
|
+
__config: IInteractionsServiceConfig;
|
|
9
10
|
isServiceDefinition?: boolean;
|
|
10
|
-
} & import("../definition").IInteractionsService,
|
|
11
|
+
} & import("../definition").IInteractionsService, IInteractionsServiceConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionsService.js","sourceRoot":"","sources":["../../../src/implementations/interactionsService.ts"],"names":[],"mappings":";;;AAAA,wDAA4D;AAG5D,8CAAsD;AACtD,iDAAmD;AACnD,iEAAmE;AAEtD,QAAA,mBAAmB,GAAG,IAAA,uCAAsB,
|
|
1
|
+
{"version":3,"file":"interactionsService.js","sourceRoot":"","sources":["../../../src/implementations/interactionsService.ts"],"names":[],"mappings":";;;AAAA,wDAA4D;AAG5D,8CAAsD;AACtD,iDAAmD;AACnD,iEAAmE;AAEtD,QAAA,mBAAmB,GAAG,IAAA,uCAAsB,EACxD,mCAAsB,EACtB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAwD,EAAE,EAAE;IAChF,OAAO,IAAA,iCAAkB,EAAC,MAAM,EAAE,UAAU,CAAC,CAAA;AAC9C,CAAC,CACD,CAAA;AAEY,QAAA,2BAA2B,GAAG,IAAA,uCAAsB,EAChE,mCAAsB,EACtB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAwD,EAAE,EAAE;IAChF,OAAO,IAAA,iDAA0B,EAAC,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;AACI,MAAM,mBAAmB,GAAG,CAAC,QAAkC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"reviveScriptElement.js","sourceRoot":"","sources":["../../../src/implementations/reviveScriptElement.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACI,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;AAXY,QAAA,mBAAmB,uBAW/B"}
|
|
@@ -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,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,
|
|
1
|
+
{"version":3,"file":"InteractionsScriptElement.js","sourceRoot":"","sources":["../../../../src/implementations/v2/InteractionsScri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
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAuthoredStylesCss = void 0;
|
|
4
|
+
const SELECTOR_TOKEN = /"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[()[\]]|,/g;
|
|
5
|
+
const escapeCssString = (value) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\a ').replace(/\r/g, '\\d ').replace(/\f/g, '\\c ');
|
|
6
|
+
const splitSelectorList = (selector) => {
|
|
7
|
+
const parts = [];
|
|
8
|
+
let depth = 0;
|
|
9
|
+
let start = 0;
|
|
10
|
+
SELECTOR_TOKEN.lastIndex = 0;
|
|
11
|
+
for (let match = SELECTOR_TOKEN.exec(selector); match; match = SELECTOR_TOKEN.exec(selector)) {
|
|
12
|
+
const token = match[0];
|
|
13
|
+
if (token === '(' || token === '[') {
|
|
14
|
+
depth++;
|
|
15
|
+
}
|
|
16
|
+
else if (token === ')' || token === ']') {
|
|
17
|
+
depth--;
|
|
18
|
+
}
|
|
19
|
+
else if (token === ',' && depth === 0) {
|
|
20
|
+
parts.push(selector.slice(start, match.index));
|
|
21
|
+
start = match.index + 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
parts.push(selector.slice(start));
|
|
25
|
+
return parts.map((part) => part.trim()).filter(Boolean);
|
|
26
|
+
};
|
|
27
|
+
const indentCssBlock = (css) => css
|
|
28
|
+
.split('\n')
|
|
29
|
+
.map((line) => (line ? ` ${line}` : line))
|
|
30
|
+
.join('\n');
|
|
31
|
+
const renderProperties = (properties) => Object.entries(properties)
|
|
32
|
+
.map(([property, value]) => ` ${property}: ${value};`)
|
|
33
|
+
.join('\n');
|
|
34
|
+
const wrapWithConditions = (block, rule) => {
|
|
35
|
+
let result = block;
|
|
36
|
+
if (rule['@container']) {
|
|
37
|
+
result = `@container ${rule['@container']} {\n${indentCssBlock(result)}\n}`;
|
|
38
|
+
}
|
|
39
|
+
if (rule['@media']) {
|
|
40
|
+
result = `@media ${rule['@media']} {\n${indentCssBlock(result)}\n}`;
|
|
41
|
+
}
|
|
42
|
+
if (rule['@supports']) {
|
|
43
|
+
result = `@supports ${rule['@supports']} {\n${indentCssBlock(result)}\n}`;
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
const buildRuleSelector = (namespace, rule) => {
|
|
48
|
+
const scopeWrapper = `[data-interact-key="${escapeCssString(namespace)}"]`;
|
|
49
|
+
const scopeRoot = `${scopeWrapper} > :first-child`;
|
|
50
|
+
if (!rule.key) {
|
|
51
|
+
if (!rule.selector) {
|
|
52
|
+
return scopeRoot;
|
|
53
|
+
}
|
|
54
|
+
return splitSelectorList(rule.selector)
|
|
55
|
+
.map((selector) => `${scopeRoot} ${selector}`)
|
|
56
|
+
.join(', ');
|
|
57
|
+
}
|
|
58
|
+
const escapedKey = escapeCssString(rule.key);
|
|
59
|
+
const keyWrapper = rule.key === namespace ? scopeWrapper : `${scopeWrapper} [data-interact-key="${escapedKey}"]`;
|
|
60
|
+
const keyRoot = `${keyWrapper} > :first-child`;
|
|
61
|
+
if (!rule.selector) {
|
|
62
|
+
return keyRoot;
|
|
63
|
+
}
|
|
64
|
+
const separator = /^\s/.test(rule.selector) ? ' ' : '';
|
|
65
|
+
return splitSelectorList(rule.selector)
|
|
66
|
+
.map((selector) => `${keyRoot}${separator}${selector}`)
|
|
67
|
+
.join(', ');
|
|
68
|
+
};
|
|
69
|
+
const getEntryStylesCss = ({ namespace, styles = [] }) => {
|
|
70
|
+
if (!styles.length) {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
if (!namespace) {
|
|
74
|
+
throw new Error('Interactions config entries with authored styles must define a namespace.');
|
|
75
|
+
}
|
|
76
|
+
return styles
|
|
77
|
+
.map((rule) => {
|
|
78
|
+
const properties = renderProperties(rule.properties);
|
|
79
|
+
if (!properties) {
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
const block = `${buildRuleSelector(namespace, rule)} {\n${properties}\n}`;
|
|
83
|
+
return wrapWithConditions(block, rule);
|
|
84
|
+
})
|
|
85
|
+
.filter(Boolean)
|
|
86
|
+
.join('\n\n');
|
|
87
|
+
};
|
|
88
|
+
const getAuthoredStylesCss = (entries) => entries.map(getEntryStylesCss).filter(Boolean).join('\n\n');
|
|
89
|
+
exports.getAuthoredStylesCss = getAuthoredStylesCss;
|
|
90
|
+
//# 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,CACjD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AAEvH,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAY,EAAE;IACxD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,cAAc,CAAC,SAAS,GAAG,CAAC,CAAA;IAC5B,KAAK,IAAI,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9F,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACtB,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YACpC,KAAK,EAAE,CAAA;QACR,CAAC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,MAAM,CAAC,CAAA;AAD/C,QAAA,oBAAoB,wBAC2B"}
|
|
@@ -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
|
|
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MOTION_PRESETS_IMPORT_URL = exports.LEGACY_WIX_MOTION_PRESETS_IMPORT_URL = exports.INTERACT_V2_IMPORT_URL = void 0;
|
|
4
4
|
exports.INTERACT_V2_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/interact@2.5.14/dist/es/web.min.js';
|
|
5
|
-
exports.
|
|
5
|
+
exports.LEGACY_WIX_MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/wix-motion-presets@1.2.0/+esm';
|
|
6
|
+
exports.MOTION_PRESETS_IMPORT_URL = 'https://cdn.jsdelivr.net/npm/@wix/motion-presets@1.0.7/dist/browser/motion-presets.min.js';
|
|
6
7
|
//# 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,sEAAsE,CAAA;AAE/F,QAAA,
|
|
1
|
+
{"version":3,"file":"cdnUrls.js","sourceRoot":"","sources":["../../../../src/implementations/v2/cdnUrls.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,sEAAsE,CAAA;AAE/F,QAAA,oCAAoC,GAAG,iEAAiE,CAAA;AAExG,QAAA,yBAAyB,GACrC,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;
|
|
@@ -29,7 +29,7 @@ const getClickTriggerCss = (config) => {
|
|
|
29
29
|
if (!selectors.length) {
|
|
30
30
|
return '';
|
|
31
31
|
}
|
|
32
|
-
return selectors.map(selector => `${selector} {\ncursor: pointer;\n}`).join('\n');
|
|
32
|
+
return selectors.map((selector) => `${selector} {\ncursor: pointer;\n}`).join('\n');
|
|
33
33
|
};
|
|
34
34
|
exports.getClickTriggerCss = getClickTriggerCss;
|
|
35
35
|
//# sourceMappingURL=clickTriggerCss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickTriggerCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/clickTriggerCss.ts"],"names":[],"mappings":";;;AAEA,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAElG;;;GAGG;AACH,MAAM,4BAA4B,GAAG,
|
|
1
|
+
{"version":3,"file":"clickTriggerCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/clickTriggerCss.ts"],"names":[],"mappings":";;;AAEA,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAElG;;;GAG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Y,QAAA,kBAAkB,sBAc9B"}
|
|
@@ -1,45 +1,12 @@
|
|
|
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
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.getV2ConfigCss = void 0;
|
|
37
4
|
const interact_v2_1 = require("@wix/interact-v2");
|
|
38
|
-
const motionPresets = __importStar(require("@wix/wix-motion-presets"));
|
|
39
5
|
const clickTriggerCss_1 = require("./clickTriggerCss");
|
|
6
|
+
const motionPresets_1 = require("./motionPresets");
|
|
40
7
|
// Interact's registry is process-global. This module is only pulled into the server bundle
|
|
41
|
-
// (`process.env.browser` DCE), so
|
|
42
|
-
interact_v2_1.Interact.registerEffects(motionPresets);
|
|
8
|
+
// (`process.env.browser` DCE), so both namespaces are registered once per Node process.
|
|
9
|
+
interact_v2_1.Interact.registerEffects(motionPresets_1.motionPresets);
|
|
43
10
|
/** Emit animation FOUC CSS and click-trigger cursor rules. */
|
|
44
11
|
const getV2ConfigCss = (config) => {
|
|
45
12
|
const animationCss = (0, interact_v2_1.generate)(config, true).trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":";;;AAAA,kDAAqD;AAErD,uDAAsD;AACtD,mDAA+C;AAI/C,2FAA2F;AAC3F,wFAAwF;AACxF,sBAAQ,CAAC,eAAe,CAAC,6BAA0C,CAAC,CAAA;AAEpE,8DAA8D;AACvD,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAChE,MAAM,YAAY,GAAG,IAAA,sBAAQ,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;AAC3D,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B"}
|