@medway-ui/native 1.1.2 → 1.3.0
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/lib/commonjs/components/Alert.js +5 -4
- package/lib/commonjs/components/Alert.js.map +1 -1
- package/lib/commonjs/components/Avatar.js +2 -1
- package/lib/commonjs/components/Avatar.js.map +1 -1
- package/lib/commonjs/components/Badge.js +2 -1
- package/lib/commonjs/components/Badge.js.map +1 -1
- package/lib/commonjs/components/Button.js +3 -2
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/CardNews.js +7 -6
- package/lib/commonjs/components/CardNews.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +122 -0
- package/lib/commonjs/components/Carousel.js.map +1 -0
- package/lib/commonjs/components/Checkbox.js +11 -2
- package/lib/commonjs/components/Checkbox.js.map +1 -1
- package/lib/commonjs/components/DropdownMenu.js +225 -0
- package/lib/commonjs/components/DropdownMenu.js.map +1 -0
- package/lib/commonjs/components/EmptyState.js +19 -20
- package/lib/commonjs/components/EmptyState.js.map +1 -1
- package/lib/commonjs/components/Feed.js +82 -0
- package/lib/commonjs/components/Feed.js.map +1 -0
- package/lib/commonjs/components/FeedNotice.js +76 -0
- package/lib/commonjs/components/FeedNotice.js.map +1 -0
- package/lib/commonjs/components/Input.js +21 -9
- package/lib/commonjs/components/Input.js.map +1 -1
- package/lib/commonjs/components/InvitePopover.js +196 -0
- package/lib/commonjs/components/InvitePopover.js.map +1 -0
- package/lib/commonjs/components/Label.js +2 -1
- package/lib/commonjs/components/Label.js.map +1 -1
- package/lib/commonjs/components/LeaderboardCard.js +58 -0
- package/lib/commonjs/components/LeaderboardCard.js.map +1 -0
- package/lib/commonjs/components/MemberRow.js +131 -0
- package/lib/commonjs/components/MemberRow.js.map +1 -0
- package/lib/commonjs/components/PageHeader.js +3 -2
- package/lib/commonjs/components/PageHeader.js.map +1 -1
- package/lib/commonjs/components/PostForm.js +182 -0
- package/lib/commonjs/components/PostForm.js.map +1 -0
- package/lib/commonjs/components/PrizeCollection.js +135 -0
- package/lib/commonjs/components/PrizeCollection.js.map +1 -0
- package/lib/commonjs/components/RadioGroup.js +22 -0
- package/lib/commonjs/components/RadioGroup.js.map +1 -1
- package/lib/commonjs/components/SectionHeader.js +36 -0
- package/lib/commonjs/components/SectionHeader.js.map +1 -0
- package/lib/commonjs/components/Switch.js +33 -19
- package/lib/commonjs/components/Switch.js.map +1 -1
- package/lib/commonjs/components/Tabs.js +156 -0
- package/lib/commonjs/components/Tabs.js.map +1 -0
- package/lib/commonjs/components/Tag.js +2 -1
- package/lib/commonjs/components/Tag.js.map +1 -1
- package/lib/commonjs/components/Text.js +60 -0
- package/lib/commonjs/components/Text.js.map +1 -0
- package/lib/commonjs/components/Toast.js +3 -2
- package/lib/commonjs/components/Toast.js.map +1 -1
- package/lib/commonjs/components/Tooltip.js +2 -2
- package/lib/commonjs/components/Tooltip.js.map +1 -1
- package/lib/commonjs/editor/NoteEditor.js +710 -0
- package/lib/commonjs/editor/NoteEditor.js.map +1 -0
- package/lib/commonjs/editor/editorHtml.generated.js +21 -0
- package/lib/commonjs/editor/editorHtml.generated.js.map +1 -0
- package/lib/commonjs/editor/index.js +33 -0
- package/lib/commonjs/editor/index.js.map +1 -0
- package/lib/commonjs/editor/protocol.js +88 -0
- package/lib/commonjs/editor/protocol.js.map +1 -0
- package/lib/commonjs/hooks/useThemeColor.js +66 -29
- package/lib/commonjs/hooks/useThemeColor.js.map +1 -1
- package/lib/commonjs/index.js +319 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/overlay-host.js +101 -0
- package/lib/commonjs/lib/overlay-host.js.map +1 -0
- package/lib/commonjs/lib/typography.js +26 -0
- package/lib/commonjs/lib/typography.js.map +1 -0
- package/lib/commonjs/nativewind-env.d.js +0 -1
- package/lib/commonjs/nativewind-env.d.js.map +1 -1
- package/lib/module/components/Alert.js +3 -2
- package/lib/module/components/Alert.js.map +1 -1
- package/lib/module/components/Avatar.js +2 -1
- package/lib/module/components/Avatar.js.map +1 -1
- package/lib/module/components/Badge.js +2 -1
- package/lib/module/components/Badge.js.map +1 -1
- package/lib/module/components/Button.js +2 -1
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/components/CardNews.js +2 -1
- package/lib/module/components/CardNews.js.map +1 -1
- package/lib/module/components/Carousel.js +117 -0
- package/lib/module/components/Carousel.js.map +1 -0
- package/lib/module/components/Checkbox.js +12 -2
- package/lib/module/components/Checkbox.js.map +1 -1
- package/lib/module/components/DropdownMenu.js +216 -0
- package/lib/module/components/DropdownMenu.js.map +1 -0
- package/lib/module/components/EmptyState.js +19 -20
- package/lib/module/components/EmptyState.js.map +1 -1
- package/lib/module/components/Feed.js +77 -0
- package/lib/module/components/Feed.js.map +1 -0
- package/lib/module/components/FeedNotice.js +73 -0
- package/lib/module/components/FeedNotice.js.map +1 -0
- package/lib/module/components/Input.js +21 -9
- package/lib/module/components/Input.js.map +1 -1
- package/lib/module/components/InvitePopover.js +183 -0
- package/lib/module/components/InvitePopover.js.map +1 -0
- package/lib/module/components/Label.js +2 -1
- package/lib/module/components/Label.js.map +1 -1
- package/lib/module/components/LeaderboardCard.js +53 -0
- package/lib/module/components/LeaderboardCard.js.map +1 -0
- package/lib/module/components/MemberRow.js +127 -0
- package/lib/module/components/MemberRow.js.map +1 -0
- package/lib/module/components/PageHeader.js +2 -1
- package/lib/module/components/PageHeader.js.map +1 -1
- package/lib/module/components/PostForm.js +174 -0
- package/lib/module/components/PostForm.js.map +1 -0
- package/lib/module/components/PrizeCollection.js +127 -0
- package/lib/module/components/PrizeCollection.js.map +1 -0
- package/lib/module/components/RadioGroup.js +21 -1
- package/lib/module/components/RadioGroup.js.map +1 -1
- package/lib/module/components/SectionHeader.js +33 -0
- package/lib/module/components/SectionHeader.js.map +1 -0
- package/lib/module/components/Switch.js +34 -20
- package/lib/module/components/Switch.js.map +1 -1
- package/lib/module/components/Tabs.js +148 -0
- package/lib/module/components/Tabs.js.map +1 -0
- package/lib/module/components/Tag.js +2 -1
- package/lib/module/components/Tag.js.map +1 -1
- package/lib/module/components/Text.js +58 -0
- package/lib/module/components/Text.js.map +1 -0
- package/lib/module/components/Toast.js +2 -1
- package/lib/module/components/Toast.js.map +1 -1
- package/lib/module/components/Tooltip.js +1 -1
- package/lib/module/components/Tooltip.js.map +1 -1
- package/lib/module/editor/NoteEditor.js +705 -0
- package/lib/module/editor/NoteEditor.js.map +1 -0
- package/lib/module/editor/editorHtml.generated.js +17 -0
- package/lib/module/editor/editorHtml.generated.js.map +1 -0
- package/lib/module/editor/index.js +5 -0
- package/lib/module/editor/index.js.map +1 -0
- package/lib/module/editor/protocol.js +83 -0
- package/lib/module/editor/protocol.js.map +1 -0
- package/lib/module/hooks/useThemeColor.js +66 -31
- package/lib/module/hooks/useThemeColor.js.map +1 -1
- package/lib/module/index.js +33 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/overlay-host.js +96 -0
- package/lib/module/lib/overlay-host.js.map +1 -0
- package/lib/module/lib/typography.js +22 -0
- package/lib/module/lib/typography.js.map +1 -0
- package/lib/module/nativewind-env.d.js +0 -1
- package/lib/module/nativewind-env.d.js.map +1 -1
- package/lib/typescript/components/Alert.d.ts.map +1 -1
- package/lib/typescript/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/Badge.d.ts.map +1 -1
- package/lib/typescript/components/Button.d.ts.map +1 -1
- package/lib/typescript/components/CardNews.d.ts.map +1 -1
- package/lib/typescript/components/Carousel.d.ts +29 -0
- package/lib/typescript/components/Carousel.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/components/DropdownMenu.d.ts +39 -0
- package/lib/typescript/components/DropdownMenu.d.ts.map +1 -0
- package/lib/typescript/components/EmptyState.d.ts +1 -1
- package/lib/typescript/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/components/Feed.d.ts +22 -0
- package/lib/typescript/components/Feed.d.ts.map +1 -0
- package/lib/typescript/components/FeedNotice.d.ts +17 -0
- package/lib/typescript/components/FeedNotice.d.ts.map +1 -0
- package/lib/typescript/components/Input.d.ts +3 -2
- package/lib/typescript/components/Input.d.ts.map +1 -1
- package/lib/typescript/components/InvitePopover.d.ts +46 -0
- package/lib/typescript/components/InvitePopover.d.ts.map +1 -0
- package/lib/typescript/components/Label.d.ts.map +1 -1
- package/lib/typescript/components/LeaderboardCard.d.ts +16 -0
- package/lib/typescript/components/LeaderboardCard.d.ts.map +1 -0
- package/lib/typescript/components/MemberRow.d.ts +40 -0
- package/lib/typescript/components/MemberRow.d.ts.map +1 -0
- package/lib/typescript/components/PageHeader.d.ts.map +1 -1
- package/lib/typescript/components/PostForm.d.ts +50 -0
- package/lib/typescript/components/PostForm.d.ts.map +1 -0
- package/lib/typescript/components/PrizeCollection.d.ts +35 -0
- package/lib/typescript/components/PrizeCollection.d.ts.map +1 -0
- package/lib/typescript/components/RadioGroup.d.ts +10 -2
- package/lib/typescript/components/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/SectionHeader.d.ts +12 -0
- package/lib/typescript/components/SectionHeader.d.ts.map +1 -0
- package/lib/typescript/components/Switch.d.ts.map +1 -1
- package/lib/typescript/components/Tabs.d.ts +32 -0
- package/lib/typescript/components/Tabs.d.ts.map +1 -0
- package/lib/typescript/components/Tag.d.ts.map +1 -1
- package/lib/typescript/components/Text.d.ts +23 -0
- package/lib/typescript/components/Text.d.ts.map +1 -0
- package/lib/typescript/components/Toast.d.ts +1 -1
- package/lib/typescript/components/Toast.d.ts.map +1 -1
- package/lib/typescript/components/Tooltip.d.ts.map +1 -1
- package/lib/typescript/editor/NoteEditor.d.ts +82 -0
- package/lib/typescript/editor/NoteEditor.d.ts.map +1 -0
- package/lib/typescript/editor/editorHtml.generated.d.ts +13 -0
- package/lib/typescript/editor/editorHtml.generated.d.ts.map +1 -0
- package/lib/typescript/editor/index.d.ts +6 -0
- package/lib/typescript/editor/index.d.ts.map +1 -0
- package/lib/typescript/editor/protocol.d.ts +153 -0
- package/lib/typescript/editor/protocol.d.ts.map +1 -0
- package/lib/typescript/hooks/useThemeColor.d.ts +4 -2
- package/lib/typescript/hooks/useThemeColor.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +28 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/overlay-host.d.ts +23 -0
- package/lib/typescript/lib/overlay-host.d.ts.map +1 -0
- package/lib/typescript/lib/typography.d.ts +12 -0
- package/lib/typescript/lib/typography.d.ts.map +1 -0
- package/package.json +36 -3
- package/setup/MedwayUiProvider.tsx +15 -3
- package/setup/metro.js +27 -5
- package/setup/tailwind.js +52 -4
- package/setup/tokens.native.css +8 -3
- package/src/components/Alert.tsx +4 -2
- package/src/components/Avatar.tsx +3 -1
- package/src/components/Badge.tsx +3 -1
- package/src/components/Button.tsx +3 -7
- package/src/components/CardNews.tsx +2 -1
- package/src/components/Carousel.tsx +152 -0
- package/src/components/Checkbox.tsx +14 -4
- package/src/components/DropdownMenu.tsx +312 -0
- package/src/components/EmptyState.tsx +21 -23
- package/src/components/Feed.tsx +96 -0
- package/src/components/FeedNotice.tsx +112 -0
- package/src/components/Input.tsx +11 -6
- package/src/components/InvitePopover.tsx +240 -0
- package/src/components/Label.tsx +3 -1
- package/src/components/LeaderboardCard.tsx +70 -0
- package/src/components/MemberRow.tsx +157 -0
- package/src/components/PageHeader.tsx +3 -1
- package/src/components/PostForm.tsx +250 -0
- package/src/components/PrizeCollection.tsx +190 -0
- package/src/components/RadioGroup.tsx +32 -3
- package/src/components/SectionHeader.tsx +45 -0
- package/src/components/Switch.tsx +65 -59
- package/src/components/Tabs.tsx +182 -0
- package/src/components/Tag.tsx +3 -1
- package/src/components/Text.tsx +66 -0
- package/src/components/Toast.tsx +3 -1
- package/src/components/Tooltip.tsx +2 -1
- package/src/editor/NoteEditor.tsx +802 -0
- package/src/editor/editorHtml.generated.ts +14 -0
- package/src/editor/index.ts +13 -0
- package/src/editor/protocol.ts +184 -0
- package/src/hooks/useThemeColor.ts +77 -32
- package/src/index.ts +153 -6
- package/src/lib/overlay-host.tsx +102 -0
- package/src/lib/typography.ts +21 -0
- package/src/nativewind-env.d.ts +2 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { EditorDocument } from "@medway-ui/notes-core";
|
|
2
|
+
/**
|
|
3
|
+
* What `getSaveData` returns. No `html` field, unlike web: generating HTML needs
|
|
4
|
+
* a DOM, which never exists outside the WebView here. Persist `json` and render
|
|
5
|
+
* HTML backend-side if needed.
|
|
6
|
+
*/
|
|
7
|
+
export type NoteEditorValue = {
|
|
8
|
+
title: string;
|
|
9
|
+
json: EditorDocument;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Same shape as the web `NoteEditor`'s handle, minus `editor` (no in-process
|
|
13
|
+
* Tiptap instance to hand out) and with the document getters async, since
|
|
14
|
+
* reading the document is a bridge round trip here.
|
|
15
|
+
*/
|
|
16
|
+
export type NoteEditorHandle = {
|
|
17
|
+
focus: (position?: "start" | "end") => void;
|
|
18
|
+
blur: () => void;
|
|
19
|
+
getDocument: () => Promise<EditorDocument>;
|
|
20
|
+
getSaveData: () => Promise<NoteEditorValue>;
|
|
21
|
+
setDocument: (doc: EditorDocument | string, options?: {
|
|
22
|
+
focus?: boolean;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
type NoteEditorProps = {
|
|
26
|
+
/**
|
|
27
|
+
* Initial document: the note's JSON, or an HTML string (parsed bundle-side,
|
|
28
|
+
* the only side with a DOM). Changing it replaces the content but keeps the
|
|
29
|
+
* instance — pass a new React `key` for a fresh undo stack, as when
|
|
30
|
+
* switching notes.
|
|
31
|
+
*/
|
|
32
|
+
document?: EditorDocument | string;
|
|
33
|
+
/** Initial title, shown above the content in its own always-visible area. */
|
|
34
|
+
initialTitle?: string;
|
|
35
|
+
titlePlaceholder?: string;
|
|
36
|
+
onChange?: (doc: EditorDocument) => void;
|
|
37
|
+
editable?: boolean;
|
|
38
|
+
/** Focuses the title if `initialTitle` is empty, otherwise the content. */
|
|
39
|
+
autofocus?: boolean | "start" | "end";
|
|
40
|
+
/** Shows the formatting bar above the editor. */
|
|
41
|
+
toolbar?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Resolves with the URL to use as the image's `src`, or `null` if the host's
|
|
44
|
+
* picker was cancelled. **Different shape from the web prop**: there is no
|
|
45
|
+
* file input here and this package carries no image-picker dependency, so
|
|
46
|
+
* picking the file is the host's job. Providing it is what enables the
|
|
47
|
+
* toolbar "Imagem" button and the `/Imagem` slash command.
|
|
48
|
+
*/
|
|
49
|
+
onImageUpload?: () => Promise<{
|
|
50
|
+
src: string;
|
|
51
|
+
alt?: string | null;
|
|
52
|
+
} | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Fires when an image inserted this session leaves the document and stays out
|
|
55
|
+
* past the grace period. Tracked bundle-side (`editor-bundle/src/main.ts`).
|
|
56
|
+
*/
|
|
57
|
+
onImageRemoved?: (src: string) => void;
|
|
58
|
+
/** Default 4000ms. */
|
|
59
|
+
imageDeleteGraceMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Native-only. The WebView never navigates, so the host decides what to open
|
|
62
|
+
* (e.g. `Linking.openURL` after validating the URL).
|
|
63
|
+
*/
|
|
64
|
+
onLinkPress?: (href: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Native-only. Starting height in dp for embedded mode: the editor sits in a
|
|
67
|
+
* native scroll container, does not scroll itself, and is resized to the
|
|
68
|
+
* height it reports over the bridge. Omit to let the WebView fill and scroll
|
|
69
|
+
* its own parent.
|
|
70
|
+
*/
|
|
71
|
+
height?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Native-only. Applied to the container and the WebView; match the host theme
|
|
74
|
+
* to avoid a flash before the WebView paints its own document background
|
|
75
|
+
* (Android is particularly sensitive).
|
|
76
|
+
*/
|
|
77
|
+
backgroundColor?: string;
|
|
78
|
+
testID?: string;
|
|
79
|
+
};
|
|
80
|
+
declare const _default: import("react").NamedExoticComponent<NoteEditorProps & import("react").RefAttributes<NoteEditorHandle>>;
|
|
81
|
+
export default _default;
|
|
82
|
+
//# sourceMappingURL=NoteEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoteEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/NoteEditor.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAEV,cAAc,EAKf,MAAM,uBAAuB,CAAC;AAiE/B;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,CAAC;IAC5C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,WAAW,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,WAAW,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IAC5C,WAAW,EAAE,CACX,GAAG,EAAE,cAAc,GAAG,MAAM,EAC5B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAC1B,IAAI,CAAC;CACX,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC;IACnC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;IACtC,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAC3E;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,sBAAsB;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;;AA+mBF,wBAAgC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT.
|
|
3
|
+
*
|
|
4
|
+
* Single-file build of the Tiptap editor that runs inside the WebView rendered
|
|
5
|
+
* by `@medway-ui/native/NoteEditor`. Regenerate with:
|
|
6
|
+
*
|
|
7
|
+
* cd editor-bundle && npm install && npm run build
|
|
8
|
+
*
|
|
9
|
+
* Source lives in `editor-bundle/src`. The bridge protocol it speaks is defined
|
|
10
|
+
* in `../native/src/editor/protocol.ts`, which both sides compile against.
|
|
11
|
+
*/
|
|
12
|
+
export declare const EDITOR_HTML: string;
|
|
13
|
+
//# sourceMappingURL=editorHtml.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editorHtml.generated.d.ts","sourceRoot":"","sources":["../../../src/editor/editorHtml.generated.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,WAAW,EAAE,MAA05ha,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as NoteEditor } from "./NoteEditor";
|
|
2
|
+
export type { NoteEditorHandle } from "./NoteEditor";
|
|
3
|
+
export type { WebViewMessageEvent } from "react-native-webview";
|
|
4
|
+
export { EDITOR_PROTOCOL_VERSION, EDITOR_RECEIVE_HANDLER, isEditorMessage, } from "./protocol";
|
|
5
|
+
export type { EditorToNativeMessage, NativeToEditorMessage, } from "./protocol";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport between React Native and the Tiptap editor inside the WebView. Both
|
|
3
|
+
* sides compile against this file — the bundle imports it through the `@/`
|
|
4
|
+
* alias in `editor-bundle/vite.config.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Invariants:
|
|
7
|
+
* - The document never crosses the bridge on keystrokes: the editor emits
|
|
8
|
+
* `change` with a revision counter, and the native side asks with
|
|
9
|
+
* `getDocument`.
|
|
10
|
+
* - Every message is validated on arrival (`isEditorMessage`: envelope plus the
|
|
11
|
+
* required fields of its variant) — the WebView renders student content, so
|
|
12
|
+
* its output is untrusted input. Documents get a second pass through
|
|
13
|
+
* `normalizeDocument` before reaching the host.
|
|
14
|
+
*/
|
|
15
|
+
import type { EditorCommand, EditorDocument, EditorSelectionState, EditorTheme, SlashCommandId, SlashMenuState } from '@medway-ui/notes-core';
|
|
16
|
+
/**
|
|
17
|
+
* Bumped whenever the message shapes below change. The native side refuses to
|
|
18
|
+
* talk to a bundle that reports a different version, which turns a stale
|
|
19
|
+
* `editorHtml.generated.ts` into a clear error instead of silent breakage.
|
|
20
|
+
*/
|
|
21
|
+
export declare const EDITOR_PROTOCOL_VERSION = 3;
|
|
22
|
+
/** Name of the global the WebView bundle installs to receive native messages. */
|
|
23
|
+
export declare const EDITOR_RECEIVE_HANDLER = "__medwayNoteEditorReceive";
|
|
24
|
+
export type NativeToEditorMessage =
|
|
25
|
+
/**
|
|
26
|
+
* `reset` rebuilds the editor instance instead of replacing the running one's
|
|
27
|
+
* content — required when opening a *different* note, since replacing content
|
|
28
|
+
* carries the previous note's undo stack over.
|
|
29
|
+
*
|
|
30
|
+
* `doc` accepts HTML as well as JSON; parse (`generateJSON`) and whitelist
|
|
31
|
+
* (`normalizeDocument`) happen bundle-side, the only side with a DOM.
|
|
32
|
+
*
|
|
33
|
+
* `focusPosition` defaults to `"end"`. `imageDeleteGraceMs` seeds the bundle's
|
|
34
|
+
* image-removal bookkeeping; read once, not reactive.
|
|
35
|
+
*/
|
|
36
|
+
{
|
|
37
|
+
type: 'setContent';
|
|
38
|
+
doc: EditorDocument | string;
|
|
39
|
+
focus: boolean;
|
|
40
|
+
focusPosition?: 'start' | 'end';
|
|
41
|
+
reset?: boolean;
|
|
42
|
+
imageDeleteGraceMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Read only on the `reset` path. Set here instead of creating editable
|
|
45
|
+
* and following up with `setEditable`, which would let a read-only note
|
|
46
|
+
* flash as editable for one frame. Defaults to `true`.
|
|
47
|
+
*/
|
|
48
|
+
editable?: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'setEditable';
|
|
51
|
+
editable: boolean;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'setTheme';
|
|
54
|
+
theme: EditorTheme;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `embedded` means the editor is inside a native scroll container: it stops
|
|
58
|
+
* filling the viewport and starts reporting `resize`, so React Native can
|
|
59
|
+
* size the WebView to the document instead of nesting two scrollers.
|
|
60
|
+
*/
|
|
61
|
+
| {
|
|
62
|
+
type: 'setLayout';
|
|
63
|
+
embedded: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'scrollCaretIntoView';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'command';
|
|
68
|
+
command: EditorCommand;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'getDocument';
|
|
71
|
+
requestId: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'runSlashCommand';
|
|
74
|
+
commandId: SlashCommandId;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'dismissSlash';
|
|
77
|
+
} | {
|
|
78
|
+
type: 'focus';
|
|
79
|
+
position: 'start' | 'end';
|
|
80
|
+
} | {
|
|
81
|
+
type: 'blur';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Inserts an image node at the current selection, once the host's
|
|
85
|
+
* `onImageUpload` resolved with a `src`. The bundle also starts tracking that
|
|
86
|
+
* `src` as "uploaded this session" — see `imageRemoved` below.
|
|
87
|
+
*/
|
|
88
|
+
| {
|
|
89
|
+
type: 'insertImage';
|
|
90
|
+
src: string;
|
|
91
|
+
alt?: string | null;
|
|
92
|
+
};
|
|
93
|
+
export type EditorToNativeMessage = {
|
|
94
|
+
type: 'ready';
|
|
95
|
+
protocol: number;
|
|
96
|
+
} | {
|
|
97
|
+
type: 'state';
|
|
98
|
+
state: EditorSelectionState;
|
|
99
|
+
}
|
|
100
|
+
/** Content changed. `revision` increases monotonically, never resets. */
|
|
101
|
+
| {
|
|
102
|
+
type: 'change';
|
|
103
|
+
revision: number;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'document';
|
|
106
|
+
requestId: string;
|
|
107
|
+
revision: number;
|
|
108
|
+
doc: EditorDocument;
|
|
109
|
+
} | {
|
|
110
|
+
type: 'slash';
|
|
111
|
+
slash: SlashMenuState;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Height of the rendered document, in CSS pixels. Only meaningful when
|
|
115
|
+
* embedded: the WebView does not scroll there, so React Native has to size it
|
|
116
|
+
* to its content.
|
|
117
|
+
*/
|
|
118
|
+
| {
|
|
119
|
+
type: 'resize';
|
|
120
|
+
height: number;
|
|
121
|
+
}
|
|
122
|
+
/** A link inside the note was tapped; the native side decides what to open. */
|
|
123
|
+
| {
|
|
124
|
+
type: 'linkPress';
|
|
125
|
+
href: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Backspace with the selection collapsed at the first cursor position of the
|
|
129
|
+
* document. `NoteEditor` uses this to hand focus back to its title field —
|
|
130
|
+
* the inverse of the title's own Enter handler.
|
|
131
|
+
*/
|
|
132
|
+
| {
|
|
133
|
+
type: 'backspaceAtDocStart';
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A `src` that `insertImage` added this session left the document and stayed
|
|
137
|
+
* out past the grace period (`imageDeleteGraceMs`).
|
|
138
|
+
*/
|
|
139
|
+
| {
|
|
140
|
+
type: 'imageRemoved';
|
|
141
|
+
src: string;
|
|
142
|
+
} | {
|
|
143
|
+
type: 'error';
|
|
144
|
+
message: string;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Guard for anything arriving from the WebView: checks the envelope *and* the
|
|
148
|
+
* required fields of the variant its `type` names. Establishes the shape, not
|
|
149
|
+
* the contents — a `document` payload's `doc` still goes through
|
|
150
|
+
* `normalizeDocument` before the native side hands it to the host.
|
|
151
|
+
*/
|
|
152
|
+
export declare const isEditorMessage: (value: unknown) => value is EditorToNativeMessage;
|
|
153
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/editor/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KA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LOR = "#3B4958";
|
|
3
4
|
declare function toCssVariable(token: ThemeColorToken): string;
|
|
5
|
+
declare function getFallbackColor(token: ThemeColorToken, aliasMap: Record<string, string>): string;
|
|
4
6
|
/**
|
|
5
7
|
* Resolve uma cor semântica do design system (tokens.native.css) em runtime.
|
|
6
8
|
* Use quando a prop `color` for obrigatória (SVG, stroke Reanimated, etc.).
|
|
7
9
|
*/
|
|
8
|
-
declare function useThemeColor(token: ThemeColorToken): string
|
|
9
|
-
export { useThemeColor, toCssVariable };
|
|
10
|
+
declare function useThemeColor(token: ThemeColorToken): string;
|
|
11
|
+
export { useThemeColor, toCssVariable, getFallbackColor, DEFAULT_COLOR };
|
|
10
12
|
export type { ThemeColorToken };
|
|
11
13
|
//# sourceMappingURL=useThemeColor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeColor.d.ts","sourceRoot":"","sources":["../../../src/hooks/useThemeColor.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,KAAK,eAAe,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useThemeColor.d.ts","sourceRoot":"","sources":["../../../src/hooks/useThemeColor.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,KAAK,eAAe,GAAG,MAAM,CAAC;AA+D9B,QAAA,MAAM,aAAa,YAAY,CAAC;AAEhC,iBAAS,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAErD;AAkBD,iBAAS,gBAAgB,CACvB,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,MAAM,CASR;AAED;;;GAGG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAcrD;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -12,6 +12,28 @@ export { EmptyState } from "@/components/EmptyState";
|
|
|
12
12
|
export type { EmptyStateProps } from "@/components/EmptyState";
|
|
13
13
|
export { PageHeader } from "@/components/PageHeader";
|
|
14
14
|
export type { PageHeaderProps } from "@/components/PageHeader";
|
|
15
|
+
export { Carousel, CarouselMediaSlide, CarouselMetricSlide, } from "@/components/Carousel";
|
|
16
|
+
export type { CarouselMediaSlideProps, CarouselMetricSlideProps, CarouselProps, } from "@/components/Carousel";
|
|
17
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/DropdownMenu";
|
|
18
|
+
export type { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuProps, DropdownMenuTriggerProps, } from "@/components/DropdownMenu";
|
|
19
|
+
export { Feed, FeedComposer, FeedTitle } from "@/components/Feed";
|
|
20
|
+
export type { FeedComposerProps, FeedProps, FeedTitleProps, } from "@/components/Feed";
|
|
21
|
+
export { FeedNotice } from "@/components/FeedNotice";
|
|
22
|
+
export type { FeedNoticeProps } from "@/components/FeedNotice";
|
|
23
|
+
export { InvitePopover, InvitePopoverCard, InvitePopoverClose, InvitePopoverContent, InvitePopoverDivider, InvitePopoverEmailRow, InvitePopoverSendButton, InvitePopoverShareButton, InvitePopoverTitle, InvitePopoverTrigger, } from "@/components/InvitePopover";
|
|
24
|
+
export type { InvitePopoverActionProps, InvitePopoverContentProps, InvitePopoverEmailRowProps, InvitePopoverProps, InvitePopoverTriggerProps, } from "@/components/InvitePopover";
|
|
25
|
+
export { LeaderboardCard, LeaderboardCardHeader, LeaderboardCardList, } from "@/components/LeaderboardCard";
|
|
26
|
+
export type { LeaderboardCardHeaderProps, LeaderboardCardProps, } from "@/components/LeaderboardCard";
|
|
27
|
+
export { MemberRow, memberRowVariants, rankIndicatorVariants } from "@/components/MemberRow";
|
|
28
|
+
export type { MemberRowProps } from "@/components/MemberRow";
|
|
29
|
+
export { PostForm, PostFormCheckboxOption, PostFormDateTimeField, PostFormDescription, PostFormHeader, PostFormMediaPicker, } from "@/components/PostForm";
|
|
30
|
+
export type { PostFormCheckboxOptionProps, PostFormDateTimeFieldProps, PostFormDescriptionProps, PostFormHeaderProps, PostFormMediaPickerProps, PostFormProps, } from "@/components/PostForm";
|
|
31
|
+
export { PrizeCollection, PrizeCollectionStats, PrizeCollectionStatsItem, PrizeItem, PrizeRow, PrizeShelf, } from "@/components/PrizeCollection";
|
|
32
|
+
export type { PrizeCollectionProps, PrizeCollectionStatsItemProps, PrizeCollectionStatsProps, PrizeItemProps, PrizeShelfProps, } from "@/components/PrizeCollection";
|
|
33
|
+
export { Text, resolveMontserratFamily } from "@/components/Text";
|
|
34
|
+
export type { TextProps } from "@/components/Text";
|
|
35
|
+
export { SectionHeader } from "@/components/SectionHeader";
|
|
36
|
+
export type { SectionHeaderProps } from "@/components/SectionHeader";
|
|
15
37
|
export { Button, buttonVariants, buttonTextVariants } from "@/components/Button";
|
|
16
38
|
export type { ButtonProps } from "@/components/Button";
|
|
17
39
|
export { Checkbox, checkboxVariants } from "@/components/Checkbox";
|
|
@@ -22,14 +44,14 @@ export { Label, labelVariants, labelTextVariants } from "@/components/Label";
|
|
|
22
44
|
export type { LabelProps } from "@/components/Label";
|
|
23
45
|
export { Loading } from "@/components/Loading";
|
|
24
46
|
export type { LoadingProps } from "@/components/Loading";
|
|
25
|
-
export {
|
|
26
|
-
export type {
|
|
47
|
+
export { Skeleton } from "@/components/Skeleton";
|
|
48
|
+
export type { SkeletonProps } from "@/components/Skeleton";
|
|
49
|
+
export { RadioGroup, RadioGroupItem, RadioGroupList, RadioGroupListItem, radioGroupVariants, } from "@/components/RadioGroup";
|
|
50
|
+
export type { RadioGroupItemProps, RadioGroupListProps } from "@/components/RadioGroup";
|
|
27
51
|
export { Select, SelectContent, SelectGroup, SelectHeader, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectText, SelectTrigger, SelectValue, SelectWrapper, selectVariants, } from "@/components/Select";
|
|
28
52
|
export type { SelectProps, SelectItemProps, SelectSize } from "@/components/Select";
|
|
29
53
|
export { Separator } from "@/components/Separator";
|
|
30
54
|
export type { SeparatorProps } from "@/components/Separator";
|
|
31
|
-
export { Skeleton } from "@/components/Skeleton";
|
|
32
|
-
export type { SkeletonProps } from "@/components/Skeleton";
|
|
33
55
|
export { Switch, switchVariants } from "@/components/Switch";
|
|
34
56
|
export type { SwitchProps } from "@/components/Switch";
|
|
35
57
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogIcon, AlertDialogOverlay, AlertDialogPortal, AlertDialogTag, AlertDialogTitle, AlertDialogTrigger, } from "@/components/AlertDialog";
|
|
@@ -42,6 +64,8 @@ export { Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, Shee
|
|
|
42
64
|
export type { SheetContainerProps, SheetFooterProps, SheetHeaderProps, SheetSide, } from "@/components/Sheet";
|
|
43
65
|
export { Tag, tagVariants, tagTextVariants } from "@/components/Tag";
|
|
44
66
|
export type { TagProps } from "@/components/Tag";
|
|
67
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsTriggerVariants, } from "@/components/Tabs";
|
|
68
|
+
export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, TabsVariant, } from "@/components/Tabs";
|
|
45
69
|
export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, toastVariants, } from "@/components/Toast";
|
|
46
70
|
export type { ToastActionElement, ToastProps } from "@/components/Toast";
|
|
47
71
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/Tooltip";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,gBAAgB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,EAChB,SAAS,GACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
type HostOrigin = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
type OverlayHostContextValue = {
|
|
7
|
+
mount: (id: string, node: ReactNode) => void;
|
|
8
|
+
unmount: (id: string) => void;
|
|
9
|
+
/** Mede a origem do host na janela (para converter pageX/pageY → coords do host). */
|
|
10
|
+
measureHostOrigin: (callback: (origin: HostOrigin) => void) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Host de overlay no topo da árvore Medway UI.
|
|
14
|
+
* Usado pelo DropdownMenu porque o Portal zustand do rn-primitives
|
|
15
|
+
* não renderiza de forma confiável dentro da stack (RNSScreen) deste app.
|
|
16
|
+
*/
|
|
17
|
+
declare function OverlayHostProvider({ children }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function useOverlayHost(): OverlayHostContextValue;
|
|
21
|
+
export { OverlayHostProvider, useOverlayHost };
|
|
22
|
+
export type { HostOrigin };
|
|
23
|
+
//# sourceMappingURL=overlay-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-host.d.ts","sourceRoot":"","sources":["../../../src/lib/overlay-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,KAAK,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC7C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,qFAAqF;IACrF,iBAAiB,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,KAAK,IAAI,CAAC;CACrE,CAAC;AAIF;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,qBAoDjE;AAED,iBAAS,cAAc,4BAMtB;AAaD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
/** Montserrat files registered by the host app (ex.: App.js useFonts). */
|
|
3
|
+
export declare const fontFamilyRegular: "MontserratRegular";
|
|
4
|
+
export declare const fontFamilyMedium: "MontserratMedium";
|
|
5
|
+
export declare const fontFamilySemibold: "MontserratSemiBold";
|
|
6
|
+
/** Figma body-sm/medium */
|
|
7
|
+
export declare const bodySmMediumStyle: TextStyle;
|
|
8
|
+
/** Figma body-xs/medium */
|
|
9
|
+
export declare const bodyXsMediumStyle: TextStyle;
|
|
10
|
+
/** Figma body-sm/semibold */
|
|
11
|
+
export declare const bodySmSemiboldStyle: TextStyle;
|
|
12
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/lib/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,EAAG,mBAA4B,CAAC;AAC9D,eAAO,MAAM,gBAAgB,EAAG,kBAA2B,CAAC;AAC5D,eAAO,MAAM,kBAAkB,EAAG,oBAA6B,CAAC;AAEhE,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB,EAAE,SAE/B,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB,EAAE,SAE/B,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,mBAAmB,EAAE,SAEjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medway-ui/native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Medway UI components for React Native (iOS/Android via Expo)",
|
|
5
5
|
"author": "Alekcarvalho",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,18 @@
|
|
|
16
16
|
"require": "./lib/commonjs/index.js",
|
|
17
17
|
"default": "./lib/module/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./note-editor": {
|
|
20
|
+
"types": "./lib/typescript/editor/index.d.ts",
|
|
21
|
+
"react-native": "./lib/module/editor/index.js",
|
|
22
|
+
"require": "./lib/commonjs/editor/index.js",
|
|
23
|
+
"default": "./lib/module/editor/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./editor/protocol": {
|
|
26
|
+
"types": "./lib/typescript/editor/protocol.d.ts",
|
|
27
|
+
"react-native": "./lib/module/editor/protocol.js",
|
|
28
|
+
"require": "./lib/commonjs/editor/protocol.js",
|
|
29
|
+
"default": "./lib/module/editor/protocol.js"
|
|
30
|
+
},
|
|
19
31
|
"./setup": {
|
|
20
32
|
"types": "./setup/index.ts",
|
|
21
33
|
"react-native": "./setup/index.ts",
|
|
@@ -38,7 +50,9 @@
|
|
|
38
50
|
"./setup/global.css"
|
|
39
51
|
],
|
|
40
52
|
"scripts": {
|
|
53
|
+
"prebuild:lib": "npm --prefix .. run build:notes-core",
|
|
41
54
|
"build:lib": "bob build",
|
|
55
|
+
"pretypecheck": "npm --prefix .. run build:notes-core",
|
|
42
56
|
"typecheck": "tsc --noEmit",
|
|
43
57
|
"release": "yarn build:lib && npm publish --access public"
|
|
44
58
|
},
|
|
@@ -47,17 +61,20 @@
|
|
|
47
61
|
"@rn-primitives/avatar": "^1.0.0",
|
|
48
62
|
"@rn-primitives/checkbox": "^1.0.0",
|
|
49
63
|
"@rn-primitives/dialog": "^1.0.0",
|
|
64
|
+
"@rn-primitives/dropdown-menu": "^1.5.2",
|
|
50
65
|
"@rn-primitives/popover": "^1.0.0",
|
|
51
|
-
"@rn-primitives/portal": "^1.
|
|
66
|
+
"@rn-primitives/portal": "^1.5.2",
|
|
52
67
|
"@rn-primitives/radio-group": "^1.0.0",
|
|
53
68
|
"@rn-primitives/select": "^1.0.0",
|
|
54
69
|
"@rn-primitives/slot": "^1.0.0",
|
|
55
70
|
"@rn-primitives/switch": "^1.0.0",
|
|
71
|
+
"@rn-primitives/tabs": "^1.5.2",
|
|
56
72
|
"@rn-primitives/tooltip": "^1.0.0"
|
|
57
73
|
},
|
|
58
74
|
"peerDependencies": {
|
|
59
75
|
"@medway-ui/core": ">=1.0.0",
|
|
60
76
|
"@medway-ui/icons": "^1.0.2",
|
|
77
|
+
"@medway-ui/notes-core": ">=0.1.0",
|
|
61
78
|
"@react-navigation/native": ">=6.0.0",
|
|
62
79
|
"@react-navigation/native-stack": ">=6.0.0",
|
|
63
80
|
"class-variance-authority": "^0.7.1",
|
|
@@ -67,6 +84,7 @@
|
|
|
67
84
|
"react-native": ">=0.73.0",
|
|
68
85
|
"react-native-reanimated": ">=3.0.0",
|
|
69
86
|
"react-native-svg": ">=15.0.0",
|
|
87
|
+
"react-native-webview": ">=13.0.0",
|
|
70
88
|
"tailwind-merge": "^3.2.0"
|
|
71
89
|
},
|
|
72
90
|
"peerDependenciesMeta": {
|
|
@@ -82,11 +100,20 @@
|
|
|
82
100
|
"@medway-ui/core": {
|
|
83
101
|
"optional": true
|
|
84
102
|
},
|
|
103
|
+
"@medway-ui/notes-core": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
85
106
|
"@react-navigation/native-stack": {
|
|
86
107
|
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"react-native-webview": {
|
|
110
|
+
"optional": true
|
|
87
111
|
}
|
|
88
112
|
},
|
|
89
113
|
"devDependencies": {
|
|
114
|
+
"@medway-ui/icons": "^1.12.0",
|
|
115
|
+
"@react-navigation/native": "^7.3.18",
|
|
116
|
+
"@react-navigation/native-stack": "^7.18.10",
|
|
90
117
|
"@types/react": "^19",
|
|
91
118
|
"class-variance-authority": "^0.7.1",
|
|
92
119
|
"clsx": "^2.1.1",
|
|
@@ -96,6 +123,7 @@
|
|
|
96
123
|
"react-native-builder-bob": "^0.30.0",
|
|
97
124
|
"react-native-reanimated": "^4.4.0",
|
|
98
125
|
"react-native-svg": "^15.15.5",
|
|
126
|
+
"react-native-webview": "^14.0.1",
|
|
99
127
|
"tailwind-merge": "^3.2.0",
|
|
100
128
|
"typescript": "^5"
|
|
101
129
|
},
|
|
@@ -110,7 +138,12 @@
|
|
|
110
138
|
}
|
|
111
139
|
],
|
|
112
140
|
"module",
|
|
113
|
-
|
|
141
|
+
[
|
|
142
|
+
"typescript",
|
|
143
|
+
{
|
|
144
|
+
"project": "tsconfig.build.json"
|
|
145
|
+
}
|
|
146
|
+
]
|
|
114
147
|
]
|
|
115
148
|
},
|
|
116
149
|
"publishConfig": {
|
|
@@ -3,6 +3,8 @@ import { View, StyleSheet } from 'react-native';
|
|
|
3
3
|
import { PortalHost } from '@rn-primitives/portal';
|
|
4
4
|
import { useColorScheme } from 'nativewind';
|
|
5
5
|
|
|
6
|
+
import { OverlayHostProvider } from '../src/lib/overlay-host';
|
|
7
|
+
|
|
6
8
|
import './global.css';
|
|
7
9
|
|
|
8
10
|
type MedwayUiTheme = 'light' | 'dark' | 'system';
|
|
@@ -25,7 +27,8 @@ type MedwayUiProviderProps = {
|
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Carrega tokens + Tailwind (NativeWind) para a subárvore.
|
|
28
|
-
*
|
|
30
|
+
* - OverlayHostProvider: DropdownMenu (acima da stack, sem Modal/Portal zustand)
|
|
31
|
+
* - PortalHost: Select/Dialog/Popover/Tooltip do rn-primitives
|
|
29
32
|
*
|
|
30
33
|
* Dark mode: requer `darkMode: 'class'` no tailwind do app (via createMedwayUiTailwindConfig).
|
|
31
34
|
*/
|
|
@@ -44,8 +47,12 @@ function MedwayUiProvider({
|
|
|
44
47
|
|
|
45
48
|
return (
|
|
46
49
|
<View style={styles.root} className={isDark ? 'dark' : undefined}>
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
<OverlayHostProvider>
|
|
51
|
+
{children}
|
|
52
|
+
<View style={styles.portalHost} pointerEvents="box-none">
|
|
53
|
+
<PortalHost />
|
|
54
|
+
</View>
|
|
55
|
+
</OverlayHostProvider>
|
|
49
56
|
</View>
|
|
50
57
|
);
|
|
51
58
|
}
|
|
@@ -54,6 +61,11 @@ const styles = StyleSheet.create({
|
|
|
54
61
|
root: {
|
|
55
62
|
flex: 1,
|
|
56
63
|
},
|
|
64
|
+
portalHost: {
|
|
65
|
+
...StyleSheet.absoluteFill,
|
|
66
|
+
zIndex: 99990,
|
|
67
|
+
elevation: 99990,
|
|
68
|
+
},
|
|
57
69
|
});
|
|
58
70
|
|
|
59
71
|
export { MedwayUiProvider };
|
package/setup/metro.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Subpaths whose `exports` entry points at `lib/` — the bob build output, which
|
|
6
|
+
* is gitignored and therefore absent in a `file:`/sibling checkout. They get the
|
|
7
|
+
* same source redirect as the package root, keyed explicitly rather than by
|
|
8
|
+
* prefix so that `setup`, `metro`, `tailwind` and `babel-brownfield` — published
|
|
9
|
+
* as-is, not built — keep resolving normally.
|
|
10
|
+
*/
|
|
11
|
+
const NATIVE_SOURCE_SUBPATHS = {
|
|
12
|
+
'@medway-ui/native/note-editor': 'editor/index.ts',
|
|
13
|
+
'@medway-ui/native/editor/protocol': 'editor/protocol.ts',
|
|
14
|
+
};
|
|
15
|
+
|
|
4
16
|
function loadWithNativeWind(projectRoot) {
|
|
5
17
|
return require(require.resolve('nativewind/metro', { paths: [projectRoot] }))
|
|
6
18
|
.withNativeWind;
|
|
@@ -215,11 +227,21 @@ function withMedwayUi(config, options = {}) {
|
|
|
215
227
|
const defaultResolveRequest = config.resolver.resolveRequest;
|
|
216
228
|
|
|
217
229
|
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
|
218
|
-
if (resolveNativeSource
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
230
|
+
if (resolveNativeSource) {
|
|
231
|
+
if (moduleName === '@medway-ui/native') {
|
|
232
|
+
return {
|
|
233
|
+
filePath: path.resolve(medwayUiNativeSrc, 'index.ts'),
|
|
234
|
+
type: 'sourceFile',
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const sourceSubpath = NATIVE_SOURCE_SUBPATHS[moduleName];
|
|
239
|
+
if (sourceSubpath) {
|
|
240
|
+
return {
|
|
241
|
+
filePath: path.resolve(medwayUiNativeSrc, sourceSubpath),
|
|
242
|
+
type: 'sourceFile',
|
|
243
|
+
};
|
|
244
|
+
}
|
|
223
245
|
}
|
|
224
246
|
|
|
225
247
|
if (isMedwayUiOrigin(context.originModulePath)) {
|