arcy.js 0.1.4 → 0.1.6
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/dist/{arcy.chat.f698fce59921.js → arcy.chat.27fabef680f1.js} +1 -1
- package/dist/arcy.flow.46ba8a96f99e.js +3 -0
- package/dist/{arcy.legacy.061d3b544569.js → arcy.legacy.98a48482777b.js} +2 -2
- package/dist/arcy.loader.js +1 -1
- package/dist/{arcy.modern.d30bb13c138a.js → arcy.modern.2c3fe0b458df.js} +2 -2
- package/dist/arcy.picker.777b2d4d1127.js +95 -0
- package/dist/{chat-VOYR3S25.js → chat-NCTVDXR5.js} +0 -3
- package/dist/{chunk-GDGE3HLE.js → chunk-7S5DA67F.js} +2 -2
- package/dist/{chunk-NY3NXM2V.js → chunk-AW7DHYSA.js} +1 -1
- package/dist/{chunk-NIHUDSWK.js → chunk-QDCO2MRA.js} +1 -1
- package/dist/design-mode.cjs +1 -1
- package/dist/design-mode.d.ts +9 -1
- package/dist/design-mode.js +2 -2
- package/dist/{flow-M7W3H3C5.js → flow-FGTIZOXU.js} +62 -17
- package/dist/index.cjs +490 -95
- package/dist/index.d.ts +21 -6
- package/dist/index.js +16 -12
- package/dist/{picker-GPZ2GHB4.js → picker-6REZLJW3.js} +417 -69
- package/package.json +1 -1
- package/dist/arcy.flow.fef131718e42.js +0 -3
- package/dist/arcy.picker.b7e531503cf2.js +0 -59
package/dist/index.d.ts
CHANGED
|
@@ -11,16 +11,31 @@ type ArcyEvent = "ready" | "open" | "close";
|
|
|
11
11
|
type ArcyEventHandler = () => void;
|
|
12
12
|
/** The function `on()` hands back. Calling it removes that one handler. */
|
|
13
13
|
type Unsubscribe = () => void;
|
|
14
|
+
/** A plain JSON object, which is what an Object attribute holds. */
|
|
15
|
+
type AttributeObject = {
|
|
16
|
+
[key: string]: AttributeJson;
|
|
17
|
+
};
|
|
18
|
+
type AttributeJson = string | number | boolean | null | AttributeJson[] | AttributeObject;
|
|
14
19
|
/**
|
|
15
|
-
* What an attribute value may be. Mirrors the
|
|
20
|
+
* What an attribute value may be. Mirrors the seven data types the backend
|
|
16
21
|
* registry accepts (PRODUCT_SCOPE §9.1.5), plus `null`, which clears the key
|
|
17
22
|
* and is the only value that does.
|
|
18
23
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
24
|
+
* **Object and Object list were added by ADR 0198**, for two real customer
|
|
25
|
+
* shapes: an array of every listing a seller has created, and that seller's
|
|
26
|
+
* single notification-preferences object. Additive to a published type
|
|
27
|
+
* (ADR 0050), so no install breaks, and it is what stops the TypeScript
|
|
28
|
+
* install refusing a shape the customer already holds.
|
|
29
|
+
*
|
|
30
|
+
* Typing is enforced server-side against the declared attribute, not here:
|
|
31
|
+
* the widget cannot know what an app has declared, and validating twice with
|
|
32
|
+
* one side guessing produces disagreements that are worse than no check at
|
|
33
|
+
* all. That is also why the caps on an object value (10KB serialized, depth
|
|
34
|
+
* 5, 200 elements, 50 keys) are not expressed here: an over-cap value is
|
|
35
|
+
* refused per key on the server and named on the Attributes page, which is
|
|
36
|
+
* the surface built to explain it.
|
|
22
37
|
*/
|
|
23
|
-
type AttributeValue = string | number | boolean | null | string[];
|
|
38
|
+
type AttributeValue = string | number | boolean | null | string[] | AttributeObject | AttributeObject[];
|
|
24
39
|
type Attributes = Record<string, AttributeValue>;
|
|
25
40
|
/**
|
|
26
41
|
* What a caller may hand `identify()`, and it is deliberately wider than what
|
|
@@ -166,4 +181,4 @@ declare const VERSION = "0.1.1";
|
|
|
166
181
|
*/
|
|
167
182
|
declare const arcy: Arcy;
|
|
168
183
|
|
|
169
|
-
export { type Arcy, type ArcyEvent, type ArcyEventHandler, type ArcyOptions, type AttributeValue, type Attributes, type AttributesInput, type Unsubscribe, VERSION, arcy as default };
|
|
184
|
+
export { type Arcy, type ArcyEvent, type ArcyEventHandler, type ArcyOptions, type AttributeObject, type AttributeValue, type Attributes, type AttributesInput, type Unsubscribe, VERSION, arcy as default };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FALLBACK_CHROME, resolveImageUrl, FONT_KEY_PROPERTY, isRenderableImageUrl, readViewport, POLICY_LINK_CLASS, BAR_TRAY_CLASS, ATTACHABLE_TYPES, TOOLTIP_CSS, surfaceWidth, clampOffsetX, dragTransform, carriesFiles, droppedFiles, MOBILE_MARGIN, CHAT_CONTRACT, CHAT_GLOBAL } from './chunk-DW3GUQ6J.js';
|
|
2
2
|
import { createShellState, safeStore, browserSessionStorage, writeJson, browserLocalStorage, readJson, hasPendingPreview, createFlowRunState, FLOW_CONTRACT, FLOW_GLOBAL } from './chunk-FR6SJSDU.js';
|
|
3
3
|
import { PICKER_CONTRACT, PICKER_GLOBAL } from './chunk-DKYMIAYF.js';
|
|
4
|
-
import { DESIGN_MODE_PROTOCOL, DESIGN_MODE_EXIT, DESIGN_MODE_SCREENSHOT, DESIGN_MODE_PICK, DESIGN_MODE_READY } from './chunk-
|
|
4
|
+
import { DESIGN_MODE_PROTOCOL, DESIGN_MODE_EXIT, DESIGN_MODE_SCREENSHOT, DESIGN_MODE_PICK, DESIGN_MODE_READY } from './chunk-7S5DA67F.js';
|
|
5
5
|
import { warn, reportCspViolations, releaseHostFocus, Z_INDEX, createShell, injectStyles } from './chunk-LGWYJSYX.js';
|
|
6
|
-
import { captureEventFingerprint, containsPii } from './chunk-
|
|
6
|
+
import { captureEventFingerprint, containsPii } from './chunk-AW7DHYSA.js';
|
|
7
7
|
|
|
8
8
|
/* arcy.js — https://arcyai.com */
|
|
9
9
|
|
|
@@ -4334,15 +4334,19 @@ function createArcyInternals(internalOptions = {}) {
|
|
|
4334
4334
|
token,
|
|
4335
4335
|
sessionToken,
|
|
4336
4336
|
sessionId: telemetry?.sessionId(),
|
|
4337
|
-
// Slice 18.1's trigger conditions read
|
|
4338
|
-
//
|
|
4339
|
-
//
|
|
4340
|
-
//
|
|
4337
|
+
// Slice 18.1's trigger conditions read attributes set via identify().
|
|
4338
|
+
// Every present, non-null value is reported as it is and judged here
|
|
4339
|
+
// not at all (ADR 0205). Filtering lists out used to report a written
|
|
4340
|
+
// key as absent, which made `has_any_value` false for a list the
|
|
4341
|
+
// customer had sent; what a value *means* is `condition.ts`'s call and
|
|
4342
|
+
// is made in one place there.
|
|
4343
|
+
//
|
|
4344
|
+
// Nothing becomes comparable by arriving: `condition.ts` refuses every
|
|
4345
|
+
// comparison on an object or an array (ADR 0198's opaque rule), so no
|
|
4346
|
+
// value here can become `is "[object Object]"`.
|
|
4341
4347
|
getTrait: (codeName) => {
|
|
4342
4348
|
const value = identity.attributes[codeName];
|
|
4343
|
-
if (value === void 0 || value === null
|
|
4344
|
-
return void 0;
|
|
4345
|
-
}
|
|
4349
|
+
if (value === void 0 || value === null) return void 0;
|
|
4346
4350
|
return value;
|
|
4347
4351
|
},
|
|
4348
4352
|
// D1299: absent entirely (rather than answering false) when storage
|
|
@@ -4722,7 +4726,7 @@ var bundledChunks = {
|
|
|
4722
4726
|
cdnBase: null,
|
|
4723
4727
|
loadChat: (win, timeoutMs, setTimeoutImpl) => importChunk(
|
|
4724
4728
|
win,
|
|
4725
|
-
() => import('./chat-
|
|
4729
|
+
() => import('./chat-NCTVDXR5.js'),
|
|
4726
4730
|
CHAT_GLOBAL,
|
|
4727
4731
|
CHAT_CONTRACT,
|
|
4728
4732
|
"chat panel",
|
|
@@ -4731,7 +4735,7 @@ var bundledChunks = {
|
|
|
4731
4735
|
),
|
|
4732
4736
|
loadFlow: (win, timeoutMs, setTimeoutImpl) => importChunk(
|
|
4733
4737
|
win,
|
|
4734
|
-
() => import('./flow-
|
|
4738
|
+
() => import('./flow-FGTIZOXU.js'),
|
|
4735
4739
|
FLOW_GLOBAL,
|
|
4736
4740
|
FLOW_CONTRACT,
|
|
4737
4741
|
"flow engine",
|
|
@@ -4740,7 +4744,7 @@ var bundledChunks = {
|
|
|
4740
4744
|
),
|
|
4741
4745
|
loadPicker: (win, timeoutMs, setTimeoutImpl) => importChunk(
|
|
4742
4746
|
win,
|
|
4743
|
-
() => import('./picker-
|
|
4747
|
+
() => import('./picker-6REZLJW3.js'),
|
|
4744
4748
|
PICKER_GLOBAL,
|
|
4745
4749
|
PICKER_CONTRACT,
|
|
4746
4750
|
"design-mode picker",
|