@myop/react 0.0.33 → 0.0.35
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/index.d.ts +20 -42
- package/dist/index.js +679 -633
- package/dist/index.umd.cjs +23 -23
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { CloudRepository } from '@myop/sdk/helpers';
|
|
2
1
|
import { CSSProperties } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { enableLocalDev } from '@myop/sdk/helpers';
|
|
3
|
+
import { getCloudRepository } from '@myop/sdk/helpers';
|
|
4
|
+
import { getPreloadedParams } from '@myop/sdk/helpers';
|
|
4
5
|
import { IMyopComponent } from '@myop/sdk/host';
|
|
6
|
+
import { isPreloaded } from '@myop/sdk/helpers';
|
|
5
7
|
import { JSX } from 'react';
|
|
8
|
+
import { preloadComponents } from '@myop/sdk/helpers';
|
|
6
9
|
import { ReactNode } from 'react';
|
|
10
|
+
import { setCloudRepository } from '@myop/sdk/helpers';
|
|
11
|
+
import { setCloudRepositoryUrl } from '@myop/sdk/helpers';
|
|
12
|
+
import { setEnvironment } from '@myop/sdk/helpers';
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
* Enable local development mode
|
|
10
|
-
*/
|
|
11
|
-
export declare const enableLocalDev: () => void;
|
|
14
|
+
export { enableLocalDev }
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Generates typed event handler props from CTA payloads.
|
|
@@ -19,18 +22,9 @@ declare type EventHandlerProps<TCtaPayloads extends Record<string, any>> = strin
|
|
|
19
22
|
[K in keyof TCtaPayloads as `on${KebabToPascal<K & string>}`]?: (payload: TCtaPayloads[K]) => void;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
* Get the current CloudRepository instance
|
|
24
|
-
*/
|
|
25
|
-
export declare const getCloudRepository: () => CloudRepository;
|
|
25
|
+
export { getCloudRepository }
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
* Get the preloaded params for a component
|
|
29
|
-
*/
|
|
30
|
-
export declare const getPreloadedParams: (componentId: string) => {
|
|
31
|
-
env: string;
|
|
32
|
-
preview: boolean;
|
|
33
|
-
} | undefined;
|
|
27
|
+
export { getPreloadedParams }
|
|
34
28
|
|
|
35
29
|
/**
|
|
36
30
|
* Base props for MyopV2ReactComponent (without generated event handlers)
|
|
@@ -50,9 +44,10 @@ declare interface IBasePropTypes<TData = any, TCtaPayloads extends Record<string
|
|
|
50
44
|
preview?: boolean;
|
|
51
45
|
/**
|
|
52
46
|
* Automatically size the component based on its content.
|
|
53
|
-
* When true, the component
|
|
54
|
-
* When false
|
|
55
|
-
*
|
|
47
|
+
* When true (default), the component behaves like a div — grows with content, width fills parent.
|
|
48
|
+
* When false, the component fills its parent container (requires parent to have explicit dimensions).
|
|
49
|
+
* Components with `<meta name="myop:size" content='{"height":"100%"}'>` automatically use fill mode.
|
|
50
|
+
* @default true
|
|
56
51
|
*/
|
|
57
52
|
autoSize?: boolean;
|
|
58
53
|
/**
|
|
@@ -110,11 +105,7 @@ declare interface IPropTypes_2 {
|
|
|
110
105
|
[key: string]: any;
|
|
111
106
|
}
|
|
112
107
|
|
|
113
|
-
|
|
114
|
-
* Check if a component is already preloaded/cached
|
|
115
|
-
* If env/preview not provided, checks if ANY version is preloaded
|
|
116
|
-
*/
|
|
117
|
-
export declare const isPreloaded: (componentId: string, env?: string, preview?: boolean) => boolean;
|
|
108
|
+
export { isPreloaded }
|
|
118
109
|
|
|
119
110
|
/**
|
|
120
111
|
* Typed Myop component interface with typed props.
|
|
@@ -158,25 +149,12 @@ export { MyopV2ReactComponent as MyopV2Container }
|
|
|
158
149
|
*/
|
|
159
150
|
declare type OnCallback<TCtaPayloads extends Record<string, any>> = string extends keyof TCtaPayloads ? (action: string, payload: any) => void : <K extends keyof TCtaPayloads>(action: K, payload: TCtaPayloads[K]) => void;
|
|
160
151
|
|
|
161
|
-
|
|
162
|
-
* Preload components for faster rendering.
|
|
163
|
-
* Continues even if some components fail to load.
|
|
164
|
-
*/
|
|
165
|
-
export declare const preloadComponents: (ids: string[], env?: string, preview?: boolean) => Promise<PromiseSettledResult<IComponentConfig>[]>;
|
|
152
|
+
export { preloadComponents }
|
|
166
153
|
|
|
167
|
-
|
|
168
|
-
* Set a custom CloudRepository instance
|
|
169
|
-
*/
|
|
170
|
-
export declare const setCloudRepository: (repository: CloudRepository) => void;
|
|
154
|
+
export { setCloudRepository }
|
|
171
155
|
|
|
172
|
-
|
|
173
|
-
* Set a custom CloudRepository URL
|
|
174
|
-
*/
|
|
175
|
-
export declare const setCloudRepositoryUrl: (url: string) => void;
|
|
156
|
+
export { setCloudRepositoryUrl }
|
|
176
157
|
|
|
177
|
-
|
|
178
|
-
* Set the default environment for component loading
|
|
179
|
-
*/
|
|
180
|
-
export declare const setEnvironment: (env: string) => void;
|
|
158
|
+
export { setEnvironment }
|
|
181
159
|
|
|
182
160
|
export { }
|