@coorax/react 0.0.0-canary.6 → 0.0.0-canary.7
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.js +35 -8
- package/package.json +10 -9
- package/dist/components/fallbacks/iframe,fallback.d.ts +0 -2
- package/dist/lifecycle/fields/focus.events/onbeforeinput.d.ts +0 -3
- package/dist/lifecycle/fields/focus.events/onblur.d.ts +0 -3
- package/dist/lifecycle/fields/focus.events/onfocus.d.ts +0 -3
- package/dist/lifecycle/fields/keyboard.events/onkeydown.d.ts +0 -3
- package/dist/lifecycle/fields/media/handlers.d.ts +0 -7
- package/dist/lifecycle/fields/media/keyboard.events/onkeydown.d.ts +0 -3
- package/dist/lifecycle/fields/media/synthetic.events/onload.d.ts +0 -3
- package/dist/lifecycle/fields/mouse.events/onclick.d.ts +0 -3
- package/dist/lifecycle/fields/mouse.events/ondoubleclick.d.ts +0 -4
- package/dist/lifecycle/fields/mouse.events/onmouseenter.d.ts +0 -3
- package/dist/lifecycle/fields/mouse.events/onmouseleave.d.ts +0 -3
- package/dist/lifecycle/fields/synthetic.events/onload.d.ts +0 -3
- package/dist/lifecycle/fields/synthetic.events/onselect.d.ts +0 -3
- package/dist/registry/errors.registry.d.ts +0 -8
- package/dist/registry/fallbacks.registry.d.ts +0 -9
- package/dist/registry/primitives.registry.d.ts +0 -22
- package/dist/registry/registry.d.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -485,9 +485,7 @@ import { cn as cn10 } from "cn";
|
|
|
485
485
|
// src/lib/comp.utils.tsx
|
|
486
486
|
import { GenericRegistry as GenericRegistry4 } from "@coorax/render-react";
|
|
487
487
|
import { createElement } from "react";
|
|
488
|
-
import {
|
|
489
|
-
Pointer
|
|
490
|
-
} from "lucide-react";
|
|
488
|
+
import { Pointer } from "lucide-react";
|
|
491
489
|
var CoraxIconsRegistry = new GenericRegistry4;
|
|
492
490
|
function CoraxIcon({ icon }) {
|
|
493
491
|
const Icon = CoraxIconsRegistry.get(icon) ?? Pointer;
|
|
@@ -495,7 +493,9 @@ function CoraxIcon({ icon }) {
|
|
|
495
493
|
}
|
|
496
494
|
|
|
497
495
|
// src/lifecycle/fields/lifecycle.utils.ts
|
|
498
|
-
import {
|
|
496
|
+
import {
|
|
497
|
+
UTILS
|
|
498
|
+
} from "@coorax/core";
|
|
499
499
|
function blockRectFromBlockId(id) {
|
|
500
500
|
const domElement = document.getElementById(id);
|
|
501
501
|
if (!domElement)
|
|
@@ -882,7 +882,36 @@ function SelectionOverlay({
|
|
|
882
882
|
}
|
|
883
883
|
|
|
884
884
|
// src/modules/slots.module.tsx
|
|
885
|
-
import {
|
|
885
|
+
import {
|
|
886
|
+
TextCursor,
|
|
887
|
+
PointerIcon,
|
|
888
|
+
HeadingIcon,
|
|
889
|
+
Heading2,
|
|
890
|
+
PlusIcon,
|
|
891
|
+
BoldIcon,
|
|
892
|
+
ItalicIcon,
|
|
893
|
+
UnderlineIcon,
|
|
894
|
+
LinkIcon,
|
|
895
|
+
ImagePlus,
|
|
896
|
+
TextInitialIcon,
|
|
897
|
+
Minus,
|
|
898
|
+
TvMinimalPlayIcon,
|
|
899
|
+
FileTextIcon,
|
|
900
|
+
QuoteIcon,
|
|
901
|
+
BracesIcon,
|
|
902
|
+
PaletteIcon,
|
|
903
|
+
Captions,
|
|
904
|
+
Trash2 as Trash25,
|
|
905
|
+
Play,
|
|
906
|
+
Pause,
|
|
907
|
+
MoveHorizontal,
|
|
908
|
+
Expand,
|
|
909
|
+
LineStyle,
|
|
910
|
+
OctagonExclamationPoint,
|
|
911
|
+
OctagonX,
|
|
912
|
+
InfoIcon,
|
|
913
|
+
CircleLetterI
|
|
914
|
+
} from "lucide-react";
|
|
886
915
|
|
|
887
916
|
// src/components/commons/youtube.tsx
|
|
888
917
|
import { cn as cn11 } from "cn";
|
|
@@ -2550,9 +2579,7 @@ function buildDividerHandlers(engine, block) {
|
|
|
2550
2579
|
}
|
|
2551
2580
|
|
|
2552
2581
|
// src/lifecycle/fields/editable/keyboard.events/onkeydown.ts
|
|
2553
|
-
import {
|
|
2554
|
-
FieldsUtils as FieldsUtils2
|
|
2555
|
-
} from "@coorax/core";
|
|
2582
|
+
import { FieldsUtils as FieldsUtils2 } from "@coorax/core";
|
|
2556
2583
|
var createOnKeyDown2 = async (engine, block, ev) => {
|
|
2557
2584
|
const fieldInfo = getFieldTypeAndTargetId(engine, ev, block);
|
|
2558
2585
|
if (!fieldInfo)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorax/react",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -27,25 +27,26 @@
|
|
|
27
27
|
"lint:fix": "oxlint --fix --max-warnings=0",
|
|
28
28
|
"fmt": "oxfmt",
|
|
29
29
|
"fmt:check": "oxfmt --check",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.app.json --noEmit",
|
|
31
31
|
"vitest": "vitest",
|
|
32
|
-
"build:css": "bunx
|
|
32
|
+
"build:css": "bunx tailwindcss -i ./styles.css -o ./dist/styles.css --minify",
|
|
33
33
|
"build:types": "tsc -p tsconfig.app.json --emitDeclarationOnly",
|
|
34
34
|
"build:js": "bun build ./src/index.ts --outdir ./dist --target browser --banner '\"use client\";' --external react --external react-dom --external @coorax/core --external @coorax/render-react --external lucide-react --external cn --external class-variance-authority --external zod",
|
|
35
35
|
"build": "bun run build:types && bun run build:js && bun run build:css",
|
|
36
36
|
"prepublishOnly": "bun run build"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@coorax/core": "
|
|
40
|
-
"@coorax/render-react": "
|
|
39
|
+
"@coorax/core": "0.0.0-canary.4",
|
|
40
|
+
"@coorax/render-react": "0.0.0-canary.3",
|
|
41
41
|
"class-variance-authority": "^0.7.1",
|
|
42
|
-
"cn": "
|
|
42
|
+
"cn": "^0.4.0",
|
|
43
43
|
"zod": "^4.6.7"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@babel/core": "^7.29.7",
|
|
47
47
|
"@rolldown/plugin-babel": "^0.2.3",
|
|
48
|
-
"@tailwindcss/
|
|
48
|
+
"@tailwindcss/cli": "^4.3.5",
|
|
49
|
+
"@tailwindcss/vite": "4.3.3",
|
|
49
50
|
"@types/babel__core": "^7.20.5",
|
|
50
51
|
"@types/node": "^24.13.3",
|
|
51
52
|
"@types/react": "^19.2.18",
|
|
@@ -57,10 +58,10 @@
|
|
|
57
58
|
"oxlint": "^1.81.0",
|
|
58
59
|
"react": "^19.2.8",
|
|
59
60
|
"react-dom": "^19.2.8",
|
|
60
|
-
"tailwindcss": "
|
|
61
|
+
"tailwindcss": "4.3.3",
|
|
61
62
|
"typescript": "~6.0.2",
|
|
62
63
|
"vite": "^8.3.0",
|
|
63
|
-
"vitest": "
|
|
64
|
+
"vitest": "^5.0.3"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"lucide-react": ">=1.55.0",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnBeforeInput: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onBeforeInput">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnBlur: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onBlur">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnFocus: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onFocus">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type Block, type BlockTag, type Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnKeyDown: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onKeyDown">>) => Promise<void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Block, Engine } from "@coorax/core";
|
|
2
|
-
import type { FieldLifeCycleEvents } from "../lifecycle.fields.types";
|
|
3
|
-
/**
|
|
4
|
-
* Family `media` : fields `image` (img) et `video` (video).
|
|
5
|
-
* Réutilise les handlers communs sauf `onBlur` (les medias n'ont pas de sauvegarde sur blur).
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildMediaHandlers(engine: Engine, block: Block): FieldLifeCycleEvents<"img" | "video">;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type Block, type BlockTag, type Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnKeyDown: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onKeyDown">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnLoad: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onLoad">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnClick: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onClick">>) => Promise<void>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { BlockTag, Block } from "@coorax/core";
|
|
2
|
-
import { Engine } from "@coorax/core";
|
|
3
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
4
|
-
export declare const createOnDoubleClick: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onDoubleClick">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnMouseEnter: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onMouseEnter">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnMouseLeave: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onMouseLeave">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnLoad: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onLoad">>) => Promise<void>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Block, BlockTag, Engine } from "@coorax/core";
|
|
2
|
-
import type { FnParams, NativeCallback } from "../lifecycle.fields.types";
|
|
3
|
-
export declare const createOnSelect: <K extends BlockTag = keyof import("@coorax/core").FieldMap | import("@coorax/core").ContainerTag>(engine: Engine, block: Block, ev: FnParams<NativeCallback<K, "onSelect">>) => Promise<void>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { JSXElementConstructor } from "react";
|
|
2
|
-
import { GenericRegistry } from "./registry";
|
|
3
|
-
import type { Block, BlockType } from "@coorax/core";
|
|
4
|
-
export interface ErrorComponentMap extends Record<BlockType, any> {
|
|
5
|
-
}
|
|
6
|
-
export type ErrorComponentKey = keyof ErrorComponentMap;
|
|
7
|
-
export type ErrorComponent = JSXElementConstructor<Block & React.PropsWithChildren>;
|
|
8
|
-
export declare const ErrorComponentsRegistry: GenericRegistry<keyof ErrorComponentMap, ErrorComponent>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { JSXElementConstructor } from "react";
|
|
2
|
-
import { GenericRegistry } from "./registry";
|
|
3
|
-
import type { Block, BlockType } from "@coorax/core";
|
|
4
|
-
import type React from "react";
|
|
5
|
-
export interface FallbackComponentMap extends Record<BlockType, any> {
|
|
6
|
-
}
|
|
7
|
-
export type FallbackKey = keyof FallbackComponentMap;
|
|
8
|
-
export type FallbackComponent = JSXElementConstructor<Block & React.PropsWithChildren>;
|
|
9
|
-
export declare const FallbackComponentsRegistry: GenericRegistry<keyof FallbackComponentMap, FallbackComponent>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BlockTag, BlockId, BlockVariant } from "@coorax/core";
|
|
2
|
-
import type { FieldLifeCycleEvents } from "../lifecycle/fields/lifecycle.fields.types";
|
|
3
|
-
export type RComponentProps<T extends BlockTag = BlockTag> = FieldLifeCycleEvents<T> & {
|
|
4
|
-
blockId: BlockId;
|
|
5
|
-
};
|
|
6
|
-
export type RComponent<T extends BlockTag = BlockTag> = (props: RComponentProps<T>) => React.ReactNode;
|
|
7
|
-
interface CR {
|
|
8
|
-
get<T extends BlockTag = BlockTag>(name: BlockVariant): RComponent<T> | null;
|
|
9
|
-
post<T extends BlockTag = BlockTag>(name: BlockVariant, comp: RComponent<T>): void;
|
|
10
|
-
getAll(names: BlockVariant[]): (RComponent | null)[];
|
|
11
|
-
batch(comps: Record<BlockVariant, RComponent>): void;
|
|
12
|
-
delete(name: BlockVariant): void;
|
|
13
|
-
}
|
|
14
|
-
export declare class PrimitivesComponentsRegistry implements CR {
|
|
15
|
-
private components;
|
|
16
|
-
get<T extends BlockTag = BlockTag>(name: BlockVariant): RComponent<T> | null;
|
|
17
|
-
getAll(names: BlockVariant[]): (RComponent | null)[];
|
|
18
|
-
post<T extends BlockTag = BlockTag>(name: BlockVariant, comp: RComponent<T>): void;
|
|
19
|
-
delete(name: BlockVariant): void;
|
|
20
|
-
batch(comps: Record<BlockVariant, RComponent>): void;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type RegistryListener = () => void;
|
|
2
|
-
export type RegistryDisposer = () => void;
|
|
3
|
-
export interface GenericRegistryInterface<K, V> {
|
|
4
|
-
get(key: K): V | undefined;
|
|
5
|
-
register(key: K, value: V): RegistryDisposer;
|
|
6
|
-
subscribe(key: K, fn: RegistryListener): RegistryDisposer;
|
|
7
|
-
}
|
|
8
|
-
export declare class GenericRegistry<K, V> implements GenericRegistryInterface<K, V> {
|
|
9
|
-
private items;
|
|
10
|
-
private listeners;
|
|
11
|
-
private notify;
|
|
12
|
-
get(key: K): V | undefined;
|
|
13
|
-
register(key: K, value: V): RegistryDisposer;
|
|
14
|
-
subscribe(key: K, fn: RegistryListener): RegistryDisposer;
|
|
15
|
-
}
|