@coorax/react 0.0.0-canary.1 → 0.0.0-canary.3

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.
Files changed (168) hide show
  1. package/dist/components/commons/button.d.ts +8 -0
  2. package/dist/components/corax-context-provider.d.ts +6 -0
  3. package/dist/components/corax-flow.d.ts +4 -0
  4. package/dist/components/fallbacks/image.fallback.d.ts +3 -0
  5. package/dist/components/slots/buttons/block-actions-button.d.ts +3 -0
  6. package/dist/components/slots/buttons/toolbar-button.d.ts +3 -0
  7. package/dist/components/slots/maps/block-actions.d.ts +1 -0
  8. package/dist/components/slots/maps/overlays.d.ts +1 -0
  9. package/dist/components/slots/maps/text-inspector.d.ts +2 -0
  10. package/dist/components/slots/maps/toolbar.d.ts +1 -0
  11. package/dist/components/slots/overlays/focus-overlay.d.ts +3 -0
  12. package/dist/components/slots/overlays/hover-overlay.d.ts +3 -0
  13. package/dist/components/slots/overlays/selection-overlay.d.ts +3 -0
  14. package/dist/components/slots/slot-button.d.ts +6 -0
  15. package/dist/components/slots/slot-component.d.ts +5 -0
  16. package/dist/components/slots/slots.d.ts +4 -0
  17. package/dist/constants/field.constants.d.ts +2 -0
  18. package/dist/hooks/custom/use-custom-ref.d.ts +1 -0
  19. package/dist/hooks/custom/use-isomorphic-layout-effect.d.ts +2 -0
  20. package/{src/hooks/index.ts → dist/hooks/index.d.ts} +1 -0
  21. package/dist/hooks/use-block-entry.d.ts +2 -0
  22. package/dist/hooks/use-block.d.ts +2 -0
  23. package/dist/hooks/use-flow.d.ts +17 -0
  24. package/dist/hooks/use-keyboard.d.ts +10 -0
  25. package/dist/hooks/use-registry.d.ts +3 -0
  26. package/dist/hooks/use-renderer.d.ts +2 -0
  27. package/dist/hooks/use-slice.d.ts +2 -0
  28. package/dist/hooks/use-slots.d.ts +2 -0
  29. package/dist/hooks/use-tasks.d.ts +7 -0
  30. package/dist/hooks/use-text-input.d.ts +2 -0
  31. package/dist/hooks/use-ui-context.d.ts +2 -0
  32. package/dist/hooks/useSelection.d.ts +2 -0
  33. package/{src/index.ts → dist/index.d.ts} +3 -4
  34. package/dist/index.js +2751 -0
  35. package/dist/lib/comp.utils.d.ts +4 -0
  36. package/dist/lib/func.utils.d.ts +3 -0
  37. package/dist/lib/selection.utils.d.ts +5 -0
  38. package/dist/lib/slots.utils.d.ts +4 -0
  39. package/dist/lifecycle/fields/focus.events/onbeforeinput.d.ts +3 -0
  40. package/dist/lifecycle/fields/focus.events/onblur.d.ts +3 -0
  41. package/dist/lifecycle/fields/focus.events/onfocus.d.ts +3 -0
  42. package/dist/lifecycle/fields/keyboard.events/onkeydown.d.ts +3 -0
  43. package/dist/lifecycle/fields/lifecycle.fields.d.ts +12 -0
  44. package/dist/lifecycle/fields/lifecycle.fields.types.d.ts +15 -0
  45. package/dist/lifecycle/fields/lifecycle.utils.d.ts +2 -0
  46. package/dist/lifecycle/fields/mouse.events/onclick.d.ts +3 -0
  47. package/dist/lifecycle/fields/mouse.events/ondoubleclick.d.ts +4 -0
  48. package/dist/lifecycle/fields/mouse.events/onmouseenter.d.ts +3 -0
  49. package/dist/lifecycle/fields/mouse.events/onmouseleave.d.ts +3 -0
  50. package/dist/lifecycle/fields/synthetic.events/onload.d.ts +3 -0
  51. package/dist/lifecycle/fields/synthetic.events/onselect.d.ts +3 -0
  52. package/dist/lifecycle/index.d.ts +1 -0
  53. package/dist/modules/autosave.module.d.ts +31 -0
  54. package/dist/modules/fallbacks.module.d.ts +7 -0
  55. package/dist/modules/slots.module.d.ts +7 -0
  56. package/dist/modules/ui-primitives.module.d.ts +7 -0
  57. package/dist/primitives/fields/field.primitives.d.ts +2 -0
  58. package/dist/primitives/index.d.ts +3 -0
  59. package/{src/registry/fallbacks.registry.tsx → dist/registry/fallbacks.registry.d.ts} +3 -4
  60. package/dist/registry/primitives.registry.d.ts +22 -0
  61. package/dist/registry/registry.d.ts +15 -0
  62. package/dist/registry/slots.registry.d.ts +4 -0
  63. package/{src/registry/ui.primitives.registry.tsx → dist/registry/ui.primitives.registry.d.ts} +3 -4
  64. package/dist/renderer/renderer.d.ts +23 -0
  65. package/dist/renderer/renderer.test.d.ts +1 -0
  66. package/{src/renderer/renderer.types.ts → dist/renderer/renderer.types.d.ts} +0 -1
  67. package/dist/renderer/renderer.utils.d.ts +14 -0
  68. package/dist/renderer/utils/divider.renderer.utils.d.ts +6 -0
  69. package/dist/services/localdb/db/db.d.ts +74 -0
  70. package/dist/services/localdb/db/db.test.d.ts +1 -0
  71. package/dist/services/localdb/lexer/lexer.d.ts +14 -0
  72. package/dist/services/localdb/lexer/lexer.test.d.ts +1 -0
  73. package/dist/services/localdb/lexer/lexer.types.d.ts +5 -0
  74. package/dist/services/localdb/operator/operator.d.ts +10 -0
  75. package/dist/services/localdb/parser/parser.constants.d.ts +3 -0
  76. package/dist/services/localdb/parser/parser.d.ts +14 -0
  77. package/dist/services/localdb/parser/parser.test.d.ts +1 -0
  78. package/dist/services/localdb/parser/parser.types.d.ts +43 -0
  79. package/dist/services/localdb/sheet/sheet.constants.d.ts +3 -0
  80. package/dist/services/localdb/sheet/sheet.d.ts +14 -0
  81. package/dist/services/localdb/sheet/sheet.types.d.ts +13 -0
  82. package/dist/styles.css +1094 -0
  83. package/package.json +29 -12
  84. package/.oxlintrc.json +0 -8
  85. package/src/components/commons/button.tsx +0 -59
  86. package/src/components/corax-context-provider.tsx +0 -47
  87. package/src/components/corax-flow.tsx +0 -44
  88. package/src/components/fallbacks/image.fallback.tsx +0 -23
  89. package/src/components/slots/buttons/block-actions-button.tsx +0 -85
  90. package/src/components/slots/buttons/toolbar-button.tsx +0 -40
  91. package/src/components/slots/maps/block-actions.tsx +0 -84
  92. package/src/components/slots/maps/overlays.tsx +0 -9
  93. package/src/components/slots/maps/text-inspector.tsx +0 -5
  94. package/src/components/slots/maps/toolbar.tsx +0 -79
  95. package/src/components/slots/overlays/focus-overlay.tsx +0 -30
  96. package/src/components/slots/overlays/hover-overlay.tsx +0 -18
  97. package/src/components/slots/overlays/selection-overlay.tsx +0 -20
  98. package/src/components/slots/slot-button.tsx +0 -20
  99. package/src/components/slots/slot-component.tsx +0 -17
  100. package/src/components/slots/slots.tsx +0 -29
  101. package/src/constants/field.constants.ts +0 -3
  102. package/src/hooks/custom/use-custom-ref.ts +0 -11
  103. package/src/hooks/use-block-entry.ts +0 -44
  104. package/src/hooks/use-block.ts +0 -11
  105. package/src/hooks/use-flow.ts +0 -83
  106. package/src/hooks/use-keyboard.ts +0 -66
  107. package/src/hooks/use-registry.ts +0 -18
  108. package/src/hooks/use-renderer.ts +0 -8
  109. package/src/hooks/use-slice.ts +0 -13
  110. package/src/hooks/use-slots.ts +0 -13
  111. package/src/hooks/use-tasks.ts +0 -33
  112. package/src/hooks/use-text-input.ts +0 -83
  113. package/src/hooks/use-ui-context.ts +0 -16
  114. package/src/hooks/useSelection.ts +0 -27
  115. package/src/lib/comp.utils.tsx +0 -44
  116. package/src/lib/func.utils.ts +0 -15
  117. package/src/lib/selection.utils.ts +0 -33
  118. package/src/lib/slots.utils.tsx +0 -23
  119. package/src/lifecycle/fields/focus.events/onbeforeinput.ts +0 -21
  120. package/src/lifecycle/fields/focus.events/onblur.ts +0 -19
  121. package/src/lifecycle/fields/focus.events/onfocus.ts +0 -16
  122. package/src/lifecycle/fields/keyboard.events/onkeydown.ts +0 -128
  123. package/src/lifecycle/fields/lifecycle.fields.ts +0 -116
  124. package/src/lifecycle/fields/lifecycle.fields.types.ts +0 -33
  125. package/src/lifecycle/fields/lifecycle.utils.ts +0 -26
  126. package/src/lifecycle/fields/mouse.events/onclick.ts +0 -79
  127. package/src/lifecycle/fields/mouse.events/ondoubleclick.ts +0 -27
  128. package/src/lifecycle/fields/mouse.events/onmouseenter.ts +0 -27
  129. package/src/lifecycle/fields/mouse.events/onmouseleave.ts +0 -21
  130. package/src/lifecycle/fields/synthetic.events/onload.ts +0 -16
  131. package/src/lifecycle/fields/synthetic.events/onselect.ts +0 -57
  132. package/src/lifecycle/index.ts +0 -1
  133. package/src/modules/autosave.module.ts +0 -238
  134. package/src/modules/fallbacks.module.tsx +0 -19
  135. package/src/modules/slots.module.tsx +0 -28
  136. package/src/modules/ui-primitives.module.tsx +0 -20
  137. package/src/primitives/fields/field.primitives.tsx +0 -86
  138. package/src/primitives/index.ts +0 -8
  139. package/src/registry/primitives.registry.tsx +0 -57
  140. package/src/registry/registry.ts +0 -44
  141. package/src/registry/slots.registry.tsx +0 -6
  142. package/src/renderer/renderer.test.ts +0 -34
  143. package/src/renderer/renderer.tsx +0 -164
  144. package/src/renderer/renderer.utils.tsx +0 -139
  145. package/src/renderer/utils/divider.renderer.utils.tsx +0 -53
  146. package/src/services/localdb/db/db.test.ts +0 -351
  147. package/src/services/localdb/db/db.ts +0 -628
  148. package/src/services/localdb/lexer/lexer.test.ts +0 -123
  149. package/src/services/localdb/lexer/lexer.ts +0 -173
  150. package/src/services/localdb/lexer/lexer.types.ts +0 -34
  151. package/src/services/localdb/operator/operator.ts +0 -16
  152. package/src/services/localdb/parser/parser.constants.ts +0 -23
  153. package/src/services/localdb/parser/parser.test.ts +0 -172
  154. package/src/services/localdb/parser/parser.ts +0 -427
  155. package/src/services/localdb/parser/parser.types.ts +0 -56
  156. package/src/services/localdb/sheet/sheet.constants.ts +0 -32
  157. package/src/services/localdb/sheet/sheet.ts +0 -47
  158. package/src/services/localdb/sheet/sheet.types.ts +0 -38
  159. package/tsconfig.app.json +0 -26
  160. package/tsconfig.json +0 -9
  161. package/tsconfig.node.json +0 -9
  162. package/tsconfig.tsbuildinfo +0 -1
  163. package/vite.config.ts +0 -9
  164. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  165. /package/{src/components/slots/index.ts → dist/components/slots/index.d.ts} +0 -0
  166. /package/{src/components/slots/maps/index.ts → dist/components/slots/maps/index.d.ts} +0 -0
  167. /package/{src/modules/index.ts → dist/modules/index.d.ts} +0 -0
  168. /package/{src/registry/index.ts → dist/registry/index.d.ts} +0 -0
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants>): React.JSX.Element;
8
+ export { Button };
@@ -0,0 +1,6 @@
1
+ import { Engine } from "@coorax/core";
2
+ import React from "react";
3
+ export declare function CoraxEngineProvider({ children }: {
4
+ children: React.ReactNode;
5
+ }): React.JSX.Element;
6
+ export declare function useEngine(): Engine;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare function CoraxFlow({ children, className, }: React.PropsWithChildren & {
3
+ className?: string;
4
+ }): React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { MediaField, NodeCommonProps } from "@coorax/core";
2
+ import type { CSSProperties } from "react";
3
+ export declare function ImageFallback({ className, style, ...props }: MediaField & NodeCommonProps<CSSProperties>): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { SlotBaseProps } from "@coorax/core";
2
+ import React from "react";
3
+ export declare const BlockActionButton: React.MemoExoticComponent<({ c, ui, ...rest }: SlotBaseProps<"block-actions", "blocks.insert" | "actions.toggle", "button">) => React.JSX.Element | null>;
@@ -0,0 +1,3 @@
1
+ import type { SlotBaseProps } from "@coorax/core";
2
+ import React from "react";
3
+ export declare const ToolbarButton: React.MemoExoticComponent<({ c, ui, }: SlotBaseProps<"toolbar", "ToolBarButton", "text.format", "button">) => React.JSX.Element>;
@@ -0,0 +1 @@
1
+ export declare function BlockActions({ className, children, ...rest }: React.ComponentProps<"div">): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Overlays(): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { SlotComponentMap } from "@coorax/core";
2
+ export declare function TextInspector({ blockId }: SlotComponentMap["TextInspector"]): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Toolbar({ className, children, ...rest }: React.ComponentProps<"div">): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { CommandType, SlotBaseProps } from "@coorax/core";
2
+ declare module "@coorax/core" { }
3
+ export declare function FocusOverlay({ c, ui }: SlotBaseProps<"overlay", CommandType, "component">): import("react").JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import type { CommandType, SlotBaseProps } from "@coorax/core";
2
+ declare module "@coorax/core" { }
3
+ export declare function HoverOverlay({ c, ui }: SlotBaseProps<"overlay", CommandType, "component">): import("react").JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import type { CommandType, SlotBaseProps } from "@coorax/core";
2
+ declare module "@coorax/core" { }
3
+ export declare function SelectionOverlay({ c, ui }: SlotBaseProps<"overlay", CommandType, "component">): import("react").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import type { ButtonContribution, UIContext } from "@coorax/core";
2
+ import React from "react";
3
+ export declare function SlotButton({ c, ui }: {
4
+ c: ButtonContribution;
5
+ ui: UIContext;
6
+ }): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
@@ -0,0 +1,5 @@
1
+ import type { ComponentContribution, UIContext } from "@coorax/core";
2
+ export declare function SlotComponent({ c, ui }: {
3
+ c: ComponentContribution;
4
+ ui: UIContext;
5
+ }): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -0,0 +1,4 @@
1
+ import { type SlotName } from "@coorax/core";
2
+ export declare function Slots({ slotName }: {
3
+ slotName: SlotName;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { FieldType } from "@coorax/core";
2
+ export declare const TEXT_FIELD_TYPE: FieldType[];
@@ -0,0 +1 @@
1
+ export declare function useCustomRef<T>(factory: T | (() => T)): import("react").RefObject<T | null>;
@@ -0,0 +1,2 @@
1
+ import { useEffect } from "react";
2
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
@@ -1,2 +1,3 @@
1
1
  export * from "./use-slice";
2
2
  export * from "./use-ui-context";
3
+ export * from "./custom/use-isomorphic-layout-effect";
@@ -0,0 +1,2 @@
1
+ import type { BlockId } from "@coorax/core";
2
+ export declare function useBlockEntry(id: BlockId): void;
@@ -0,0 +1,2 @@
1
+ import type { Block, BlockId } from "@coorax/core";
2
+ export declare function useBlock<T extends Block = Block>(id: BlockId): T;
@@ -0,0 +1,17 @@
1
+ export declare function editorRectFromDomElement(domElement: HTMLElement): {
2
+ scrollTop: number;
3
+ scrollLeft: number;
4
+ clientLeft: number;
5
+ clientTop: number;
6
+ top: number;
7
+ left: number;
8
+ bottom: number;
9
+ right: number;
10
+ width: number;
11
+ height: number;
12
+ offsetTop: number;
13
+ offsetLeft: number;
14
+ offsetWidth: number;
15
+ offsetHeight: number;
16
+ };
17
+ export declare function useFlow(): void;
@@ -0,0 +1,10 @@
1
+ type KeyboardState = {
2
+ eventType: string | null;
3
+ ctrlKey: boolean;
4
+ metaKey: boolean;
5
+ altKey: boolean;
6
+ currentKey: string | null;
7
+ shiftKey: boolean;
8
+ };
9
+ export declare function useKeyboard(): KeyboardState | null;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { SlotKey } from "@coorax/core";
2
+ export declare function useRegistryComponent(name: SlotKey): import("react").JSXElementConstructor<any> | undefined;
3
+ export declare function useUIPrimitivesRegistry(name: SlotKey): import("../registry").UIPrimitivesComponent | undefined;
@@ -0,0 +1,2 @@
1
+ import { ReactRenderer } from "../renderer/renderer";
2
+ export declare function useRenderer(): ReactRenderer;
@@ -0,0 +1,2 @@
1
+ import type { SliceName, SliceValue } from "@coorax/core";
2
+ export declare function useSlice<T extends SliceName = SliceName>(sliceName: T): SliceValue<T> | undefined;
@@ -0,0 +1,2 @@
1
+ import type { Contribution, SlotName } from "@coorax/core";
2
+ export declare function useSlots(slotName: SlotName): readonly Contribution[];
@@ -0,0 +1,7 @@
1
+ import type { TaskFunction, TaskID, TaskName, TaskState } from "@coorax/core";
2
+ export interface UseTasksReturn extends TaskState {
3
+ flush: () => Promise<void>;
4
+ cancel: () => boolean;
5
+ schedule: (delay: number, fn: TaskFunction, taskId?: TaskID) => () => void;
6
+ }
7
+ export declare function useTasks<T extends TaskName = TaskName>(name: T): UseTasksReturn;
@@ -0,0 +1,2 @@
1
+ import type { Engine } from "@coorax/core";
2
+ export declare function useTextInput(engine: Engine): void;
@@ -0,0 +1,2 @@
1
+ import type { UIContext } from "@coorax/core";
2
+ export declare function useUIContext(): UIContext;
@@ -0,0 +1,2 @@
1
+ import type { Engine } from "@coorax/core";
2
+ export declare function useTextSelection(engine: Engine): void;
@@ -3,9 +3,8 @@ export * from "./modules";
3
3
  export * from "./components";
4
4
  export * from "./hooks";
5
5
  export * from "@coorax/core";
6
-
7
6
  declare module "@coorax/core" {
8
- interface TEventMap {
9
- "field:lifecycle": FieldLifeCycleEvProps;
10
- }
7
+ interface TEventMap {
8
+ "field:lifecycle": FieldLifeCycleEvProps;
9
+ }
11
10
  }