@chaibuilder/sdk 2.2.37 → 2.3.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.
- package/dist/core.cjs +4 -4
- package/dist/core.d.ts +22 -0
- package/dist/core.js +572 -459
- package/package.json +1 -1
package/dist/core.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { default as default_2 } from 'react';
|
|
|
4
4
|
import { default as i18n } from 'i18next';
|
|
5
5
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
6
|
import * as React_2 from 'react';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
7
8
|
import { RESET } from 'jotai/utils';
|
|
8
9
|
import { ThrottledFunction } from '@react-hookz/web';
|
|
9
10
|
import { useTranslation } from 'react-i18next';
|
|
@@ -294,6 +295,12 @@ export declare const ChaiDefaultBlocks: ({ parentId, position, gridCols, }: {
|
|
|
294
295
|
gridCols?: string;
|
|
295
296
|
}) => JSX_2.Element;
|
|
296
297
|
|
|
298
|
+
declare type ChaiFlagOptions = {
|
|
299
|
+
key: string;
|
|
300
|
+
value?: any;
|
|
301
|
+
description?: string;
|
|
302
|
+
};
|
|
303
|
+
|
|
297
304
|
export declare const ChaiImportHTML: ({ parentId, position }: {
|
|
298
305
|
parentId?: string;
|
|
299
306
|
position?: number;
|
|
@@ -440,6 +447,11 @@ declare type HTMLString = string;
|
|
|
440
447
|
|
|
441
448
|
export { i18n }
|
|
442
449
|
|
|
450
|
+
export declare const IfChaiFeatureFlag: ({ flagKey, children }: {
|
|
451
|
+
flagKey: string;
|
|
452
|
+
children: React.ReactNode;
|
|
453
|
+
}) => ReactNode;
|
|
454
|
+
|
|
443
455
|
declare type MediaManagerProps = {
|
|
444
456
|
assetId?: string;
|
|
445
457
|
close: () => void;
|
|
@@ -491,6 +503,10 @@ export declare const registerBlockSettingWidget: (id: string, component: React.C
|
|
|
491
503
|
|
|
492
504
|
export declare const registerChaiAddBlockTab: (id: string, tab: Omit<AddBlockTab, "id">) => void;
|
|
493
505
|
|
|
506
|
+
export declare const registerChaiFeatureFlag: (key: string, flagOptions: Omit<ChaiFlagOptions, "key">) => void;
|
|
507
|
+
|
|
508
|
+
export declare const registerChaiFeatureFlags: (flags: Record<string, Omit<ChaiFlagOptions, "key">>) => void;
|
|
509
|
+
|
|
494
510
|
export declare const registerChaiLibrary: <T extends Record<string, any> = Record<string, any>>(id: string, library: Omit<ChaiLibraryConfig<T>, "id">) => void;
|
|
495
511
|
|
|
496
512
|
export declare const registerChaiMediaManager: (component: React.ComponentType<MediaManagerProps>) => void;
|
|
@@ -577,6 +593,10 @@ export declare const useCanvasDisplayWidth: () => readonly [number, (args_0: num
|
|
|
577
593
|
*/
|
|
578
594
|
export declare const useCanvasZoom: () => [number, (args_0: number | RESET | ((prev: number) => number | RESET)) => void];
|
|
579
595
|
|
|
596
|
+
export declare const useChaiFeatureFlag: (flagKey: string) => boolean;
|
|
597
|
+
|
|
598
|
+
export declare const useChaiFeatureFlags: () => Record<string, ChaiFlagOptions>;
|
|
599
|
+
|
|
580
600
|
/**
|
|
581
601
|
* Custom hook to access the current state of the code editor.
|
|
582
602
|
* @category Hooks
|
|
@@ -793,6 +813,8 @@ export declare const useTheme: () => readonly [{
|
|
|
793
813
|
|
|
794
814
|
export declare const useThemeOptions: () => ChaiBuilderThemeOptions;
|
|
795
815
|
|
|
816
|
+
export declare const useToggleChaiFeatureFlag: (flagKey: string) => () => void;
|
|
817
|
+
|
|
796
818
|
export { useTranslation }
|
|
797
819
|
|
|
798
820
|
export declare const useUndoManager: () => {
|