arlo-react-native 0.1.0 → 0.1.1

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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createReactNativeFlowCache = createReactNativeFlowCache;
4
+ const arlo_sdk_1 = require("arlo-sdk");
5
+ function createReactNativeFlowCache(options) {
6
+ const storage = {
7
+ getItem: options.storage.getItem.bind(options.storage),
8
+ setItem: options.storage.setItem.bind(options.storage),
9
+ removeItem: options.storage.removeItem.bind(options.storage),
10
+ };
11
+ return (0, arlo_sdk_1.createPersistentFlowCache)({
12
+ storage,
13
+ namespace: options.namespace,
14
+ maxAgeMs: options.maxAgeMs,
15
+ });
16
+ }
17
+ //# sourceMappingURL=storage-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-cache.js","sourceRoot":"","sources":["../src/storage-cache.ts"],"names":[],"mappings":";;AAcA,gEAcC;AA5BD,uCAA4E;AAc5E,SAAgB,0BAA0B,CACxC,OAA0C;IAE1C,MAAM,OAAO,GAAqB;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACtD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACtD,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;KAC7D,CAAC;IAEF,OAAO,IAAA,oCAAyB,EAAC;QAC/B,OAAO;QACP,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from "react";
2
+ import type { FlowBridgeHandlers, FlowComponent, FlowSession, FlowSessionSnapshot, Screen } from "arlo-sdk";
3
+ import type { ArloRegistry } from "./registry";
4
+ export interface ArloComponentRenderContext {
5
+ session: FlowSession;
6
+ snapshot: FlowSessionSnapshot;
7
+ handlers?: FlowBridgeHandlers;
8
+ onValueChange: (fieldKey: string, value: string | string[] | number | boolean | null) => void;
9
+ onPressButton: (componentId: string) => Promise<void>;
10
+ }
11
+ export type ArloComponentRenderer<T extends FlowComponent = FlowComponent> = (component: T, context: ArloComponentRenderContext) => ReactNode;
12
+ export type ArloComponentRendererMap = Partial<{
13
+ [K in FlowComponent["type"]]: ArloComponentRenderer<Extract<FlowComponent, {
14
+ type: K;
15
+ }>>;
16
+ }>;
17
+ export type ArloCustomScreenRenderer = (screen: Screen, context: ArloComponentRenderContext) => ReactNode;
18
+ export interface ArloFlowRendererProps {
19
+ session: FlowSession;
20
+ handlers?: FlowBridgeHandlers;
21
+ componentRenderers?: ArloComponentRendererMap;
22
+ registry?: ArloRegistry;
23
+ autoStart?: boolean;
24
+ emptyState?: ReactNode;
25
+ unsupportedComponent?: (component: FlowComponent) => ReactNode;
26
+ unsupportedScreen?: (screen: Screen) => ReactNode;
27
+ onSnapshotChange?: (snapshot: FlowSessionSnapshot) => void;
28
+ }
29
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,aAAa,EAAE,CAAC,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
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { ArloPresentationState, ArloPresenter } from "arlo-sdk";
2
+ export declare function useArloPresenter(presenter: ArloPresenter): ArloPresentationState;
3
+ //# sourceMappingURL=useArloPresenter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArloPresenter.d.ts","sourceRoot":"","sources":["../src/useArloPresenter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,qBAAqB,CAMhF"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useArloPresenter = useArloPresenter;
4
+ const react_1 = require("react");
5
+ function useArloPresenter(presenter) {
6
+ const [state, setState] = (0, react_1.useState)(() => presenter.getState());
7
+ (0, react_1.useEffect)(() => presenter.subscribe(setState), [presenter]);
8
+ return state;
9
+ }
10
+ //# sourceMappingURL=useArloPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useArloPresenter.js","sourceRoot":"","sources":["../src/useArloPresenter.ts"],"names":[],"mappings":";;AAIA,4CAMC;AAVD,iCAA4C;AAI5C,SAAgB,gBAAgB,CAAC,SAAwB;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAwB,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEtF,IAAA,iBAAS,EAAC,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAE5D,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,25 @@
1
1
  {
2
2
  "name": "arlo-react-native",
3
- "version": "0.1.0",
4
- "main": "./src/index.ts",
5
- "types": "./src/index.ts",
3
+ "version": "0.1.1",
4
+ "description": "React Native renderer and cache helpers for Arlo flows.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "react-native": "./dist/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.build.json",
21
+ "prepack": "npm run build --prefix ../arlo-sdk && npm run build"
22
+ },
6
23
  "sideEffects": false,
7
24
  "dependencies": {
8
25
  "arlo-sdk": "^0.1.0"