@adminide-stack/yantra-mobile 12.0.140 → 12.0.141

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 (213) hide show
  1. package/lib/features/agent-chat/NativeAgentChat.js +21 -4
  2. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  3. package/lib/features/chat/ApprovalCard.js +353 -0
  4. package/lib/features/chat/ApprovalCard.js.map +1 -0
  5. package/lib/features/chat/AskUserCard.js +9 -2
  6. package/lib/features/chat/AskUserCard.js.map +1 -1
  7. package/lib/features/chat/askUser.js +25 -3
  8. package/lib/features/chat/askUser.js.map +1 -1
  9. package/lib/features/chat/queuedFollowUpRows.js +13 -0
  10. package/lib/features/chat/queuedFollowUpRows.js.map +1 -0
  11. package/lib/features/discover/DiscoverArticle.js +105 -92
  12. package/lib/features/discover/DiscoverArticle.js.map +1 -1
  13. package/lib/features/discover/DiscoverFeed.js +97 -48
  14. package/lib/features/discover/DiscoverFeed.js.map +1 -1
  15. package/lib/features/discover/DiscoverFollowUp.js +135 -0
  16. package/lib/features/discover/DiscoverFollowUp.js.map +1 -0
  17. package/lib/features/discover/DiscoverSidebar.js +555 -0
  18. package/lib/features/discover/DiscoverSidebar.js.map +1 -0
  19. package/lib/features/discover/DiscoverSkeletons.js +123 -0
  20. package/lib/features/discover/DiscoverSkeletons.js.map +1 -0
  21. package/lib/features/discover/DiscoverStoryCards.js +193 -87
  22. package/lib/features/discover/DiscoverStoryCards.js.map +1 -1
  23. package/lib/features/discover/followUpQuery.js +42 -0
  24. package/lib/features/discover/followUpQuery.js.map +1 -0
  25. package/lib/features/discover/markets.js +37 -0
  26. package/lib/features/discover/markets.js.map +1 -0
  27. package/lib/features/discover/useDiscoverSidebar.js +148 -0
  28. package/lib/features/discover/useDiscoverSidebar.js.map +1 -0
  29. package/lib/features/discover/weather.js +42 -0
  30. package/lib/features/discover/weather.js.map +1 -0
  31. package/lib/features/expenses/ExpensesAgentChatPane.js +1 -1
  32. package/lib/features/expenses/ExpensesAgentChatPane.js.map +1 -1
  33. package/lib/features/inbox/InboxAgentChatPane.js +1 -1
  34. package/lib/features/inbox/InboxAgentChatPane.js.map +1 -1
  35. package/lib/features/job-search/JobSearchAgentChatPane.js +1 -0
  36. package/lib/features/job-search/JobSearchAgentChatPane.js.map +1 -1
  37. package/lib/features/local-services/LocalServicesAgentChatPane.js +1 -1
  38. package/lib/features/local-services/LocalServicesAgentChatPane.js.map +1 -1
  39. package/lib/features/movies/MoviesAgentChatPane.js +1 -1
  40. package/lib/features/movies/MoviesAgentChatPane.js.map +1 -1
  41. package/lib/features/notion/NotionBlockSheets.js +206 -0
  42. package/lib/features/notion/NotionBlockSheets.js.map +1 -0
  43. package/lib/features/notion/NotionBlockView.js +36 -0
  44. package/lib/features/notion/NotionBlockView.js.map +1 -0
  45. package/lib/features/notion/NotionCommentsSheet.js +461 -0
  46. package/lib/features/notion/NotionCommentsSheet.js.map +1 -0
  47. package/lib/features/notion/NotionConnectionsSheet.js +244 -0
  48. package/lib/features/notion/NotionConnectionsSheet.js.map +1 -0
  49. package/lib/features/notion/NotionHistorySheet.js +439 -0
  50. package/lib/features/notion/NotionHistorySheet.js.map +1 -0
  51. package/lib/features/notion/NotionMediaBlocks.js +803 -0
  52. package/lib/features/notion/NotionMediaBlocks.js.map +1 -0
  53. package/lib/features/notion/NotionMentionSheet.js +279 -0
  54. package/lib/features/notion/NotionMentionSheet.js.map +1 -0
  55. package/lib/features/notion/NotionPageMenu.js +585 -0
  56. package/lib/features/notion/NotionPageMenu.js.map +1 -0
  57. package/lib/features/notion/NotionPageTree.js +220 -0
  58. package/lib/features/notion/NotionPageTree.js.map +1 -0
  59. package/lib/features/notion/NotionPageView.js +1253 -152
  60. package/lib/features/notion/NotionPageView.js.map +1 -1
  61. package/lib/features/notion/NotionShareSheet.js +606 -0
  62. package/lib/features/notion/NotionShareSheet.js.map +1 -0
  63. package/lib/features/notion/NotionSheets.js +87 -15
  64. package/lib/features/notion/NotionSheets.js.map +1 -1
  65. package/lib/features/notion/NotionSidebarSections.js +492 -0
  66. package/lib/features/notion/NotionSidebarSections.js.map +1 -0
  67. package/lib/features/notion/NotionWorkspaceAdmin.js +659 -0
  68. package/lib/features/notion/NotionWorkspaceAdmin.js.map +1 -0
  69. package/lib/features/notion/NotionWorkspaceView.js +257 -45
  70. package/lib/features/notion/NotionWorkspaceView.js.map +1 -1
  71. package/lib/features/notion/database/DatabaseCells.js +554 -0
  72. package/lib/features/notion/database/DatabaseCells.js.map +1 -0
  73. package/lib/features/notion/database/DatabaseDateLayouts.js +792 -0
  74. package/lib/features/notion/database/DatabaseDateLayouts.js.map +1 -0
  75. package/lib/features/notion/database/DatabaseLayouts.js +461 -0
  76. package/lib/features/notion/database/DatabaseLayouts.js.map +1 -0
  77. package/lib/features/notion/database/DatabaseSheets.js +791 -0
  78. package/lib/features/notion/database/DatabaseSheets.js.map +1 -0
  79. package/lib/features/notion/database/NotionDatabaseView.js +817 -0
  80. package/lib/features/notion/database/NotionDatabaseView.js.map +1 -0
  81. package/lib/features/notion/database/RowPropertiesPanel.js +162 -0
  82. package/lib/features/notion/database/RowPropertiesPanel.js.map +1 -0
  83. package/lib/features/notion/database/chartData.js +89 -0
  84. package/lib/features/notion/database/chartData.js.map +1 -0
  85. package/lib/features/notion/database/chartView.js +112 -0
  86. package/lib/features/notion/database/chartView.js.map +1 -0
  87. package/lib/features/notion/database/connectorButton.js +33 -0
  88. package/lib/features/notion/database/connectorButton.js.map +1 -0
  89. package/lib/features/notion/database/databaseCalc.js +208 -0
  90. package/lib/features/notion/database/databaseCalc.js.map +1 -0
  91. package/lib/features/notion/database/databaseCalendar.js +157 -0
  92. package/lib/features/notion/database/databaseCalendar.js.map +1 -0
  93. package/lib/features/notion/database/databaseCsv.js +98 -0
  94. package/lib/features/notion/database/databaseCsv.js.map +1 -0
  95. package/lib/features/notion/database/databaseCsvActions.js +58 -0
  96. package/lib/features/notion/database/databaseCsvActions.js.map +1 -0
  97. package/lib/features/notion/database/databaseFilter.js +473 -0
  98. package/lib/features/notion/database/databaseFilter.js.map +1 -0
  99. package/lib/features/notion/database/databaseFormula.js +1072 -0
  100. package/lib/features/notion/database/databaseFormula.js.map +1 -0
  101. package/lib/features/notion/database/databaseGroup.js +151 -0
  102. package/lib/features/notion/database/databaseGroup.js.map +1 -0
  103. package/lib/features/notion/database/databaseRollup.js +58 -0
  104. package/lib/features/notion/database/databaseRollup.js.map +1 -0
  105. package/lib/features/notion/database/databaseTimeline.js +156 -0
  106. package/lib/features/notion/database/databaseTimeline.js.map +1 -0
  107. package/lib/features/notion/database/databaseView.js +1188 -0
  108. package/lib/features/notion/database/databaseView.js.map +1 -0
  109. package/lib/features/notion/database/databaseViews.js +310 -0
  110. package/lib/features/notion/database/databaseViews.js.map +1 -0
  111. package/lib/features/notion/database/relationSource.js +92 -0
  112. package/lib/features/notion/database/relationSource.js.map +1 -0
  113. package/lib/features/notion/database/uniqueId.js +17 -0
  114. package/lib/features/notion/database/uniqueId.js.map +1 -0
  115. package/lib/features/notion/database/useNotionDatabase.js +617 -0
  116. package/lib/features/notion/database/useNotionDatabase.js.map +1 -0
  117. package/lib/features/notion/notionAgentRunStatus.js +39 -0
  118. package/lib/features/notion/notionAgentRunStatus.js.map +1 -0
  119. package/lib/features/notion/notionCodeLanguages.js +112 -0
  120. package/lib/features/notion/notionCodeLanguages.js.map +1 -0
  121. package/lib/features/notion/notionComments.js +86 -0
  122. package/lib/features/notion/notionComments.js.map +1 -0
  123. package/lib/features/notion/notionConnections.js +74 -0
  124. package/lib/features/notion/notionConnections.js.map +1 -0
  125. package/lib/features/notion/notionDocuments.js +453 -1
  126. package/lib/features/notion/notionDocuments.js.map +1 -1
  127. package/lib/features/notion/notionEditorModel.js +142 -7
  128. package/lib/features/notion/notionEditorModel.js.map +1 -1
  129. package/lib/features/notion/notionMarkdownShortcuts.js +51 -0
  130. package/lib/features/notion/notionMarkdownShortcuts.js.map +1 -0
  131. package/lib/features/notion/notionMedia.js +119 -0
  132. package/lib/features/notion/notionMedia.js.map +1 -0
  133. package/lib/features/notion/notionMentionDate.js +32 -0
  134. package/lib/features/notion/notionMentionDate.js.map +1 -0
  135. package/lib/features/notion/notionMentionOptions.js +162 -0
  136. package/lib/features/notion/notionMentionOptions.js.map +1 -0
  137. package/lib/features/notion/notionNotesAgent.js +445 -0
  138. package/lib/features/notion/notionNotesAgent.js.map +1 -0
  139. package/lib/features/notion/notionPageAccess.js +168 -0
  140. package/lib/features/notion/notionPageAccess.js.map +1 -0
  141. package/lib/features/notion/notionPageActions.js +138 -0
  142. package/lib/features/notion/notionPageActions.js.map +1 -0
  143. package/lib/features/notion/notionPageHistory.js +154 -0
  144. package/lib/features/notion/notionPageHistory.js.map +1 -0
  145. package/lib/features/notion/notionPageKinds.js +200 -0
  146. package/lib/features/notion/notionPageKinds.js.map +1 -0
  147. package/lib/features/notion/notionRecents.js +48 -0
  148. package/lib/features/notion/notionRecents.js.map +1 -0
  149. package/lib/features/notion/notionRichText.js +177 -0
  150. package/lib/features/notion/notionRichText.js.map +1 -0
  151. package/lib/features/notion/notionRichTitle.js +336 -0
  152. package/lib/features/notion/notionRichTitle.js.map +1 -0
  153. package/lib/features/notion/useNotionWorkspace.js +272 -13
  154. package/lib/features/notion/useNotionWorkspace.js.map +1 -1
  155. package/lib/features/notion/usePageActions.js +155 -0
  156. package/lib/features/notion/usePageActions.js.map +1 -0
  157. package/lib/features/resume/ResumeAgentChatPane.js +1 -1
  158. package/lib/features/resume/ResumeAgentChatPane.js.map +1 -1
  159. package/lib/features/shopping/ShoppingAgentChatPane.js +1 -1
  160. package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
  161. package/lib/features/study/StudyAgentChatPane.js +1 -1
  162. package/lib/features/study/StudyAgentChatPane.js.map +1 -1
  163. package/lib/features/travel/TravelAgentChatPane.js +1 -1
  164. package/lib/features/travel/TravelAgentChatPane.js.map +1 -1
  165. package/lib/features/webbuilder/WebBuilderExperience.js +40 -8
  166. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  167. package/lib/features/webbuilder/buildFragments.js +1 -1
  168. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  169. package/lib/features/webbuilder/codeFiles.js +302 -0
  170. package/lib/features/webbuilder/codeFiles.js.map +1 -0
  171. package/lib/features/webbuilder/codeHighlight.js +209 -0
  172. package/lib/features/webbuilder/codeHighlight.js.map +1 -0
  173. package/lib/features/webbuilder/components/CodeView.js +682 -52
  174. package/lib/features/webbuilder/components/CodeView.js.map +1 -1
  175. package/lib/features/webbuilder/components/PreviewScreen.js +59 -38
  176. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  177. package/lib/features/webbuilder/components/ProjectChat.js +3 -3
  178. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  179. package/lib/features/webbuilder/stepLabels.js +68 -0
  180. package/lib/features/webbuilder/stepLabels.js.map +1 -0
  181. package/lib/hooks/useHostChatSteering.js +45 -0
  182. package/lib/hooks/useHostChatSteering.js.map +1 -0
  183. package/lib/screens/Chat/index.js +2 -12
  184. package/lib/screens/Chat/index.js.map +1 -1
  185. package/lib/screens/ExpensesNative/useExpensesHostChat.js +25 -5
  186. package/lib/screens/ExpensesNative/useExpensesHostChat.js.map +1 -1
  187. package/lib/screens/InboxNative/useInboxHostChat.js +25 -5
  188. package/lib/screens/InboxNative/useInboxHostChat.js.map +1 -1
  189. package/lib/screens/JobSearchNative/useJobSearchHostChat.js +25 -5
  190. package/lib/screens/JobSearchNative/useJobSearchHostChat.js.map +1 -1
  191. package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js +25 -5
  192. package/lib/screens/LocalServicesNative/useLocalServicesHostChat.js.map +1 -1
  193. package/lib/screens/MoviesNative/useMoviesHostChat.js +25 -5
  194. package/lib/screens/MoviesNative/useMoviesHostChat.js.map +1 -1
  195. package/lib/screens/NotionPage/index.js +2 -2
  196. package/lib/screens/NotionPage/index.js.map +1 -1
  197. package/lib/screens/ResumeNative/useResumeHostChat.js +25 -5
  198. package/lib/screens/ResumeNative/useResumeHostChat.js.map +1 -1
  199. package/lib/screens/ShoppingNative/useShoppingHostChat.js +25 -5
  200. package/lib/screens/ShoppingNative/useShoppingHostChat.js.map +1 -1
  201. package/lib/screens/StudyNative/useStudyHostChat.js +25 -5
  202. package/lib/screens/StudyNative/useStudyHostChat.js.map +1 -1
  203. package/lib/screens/TravelNative/useTravelHostChat.js +25 -5
  204. package/lib/screens/TravelNative/useTravelHostChat.js.map +1 -1
  205. package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +222 -0
  206. package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -0
  207. package/lib/screens/WebBuilderNative/index.js +1 -1
  208. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  209. package/lib/screens/WebBuilderNative/sandboxProxyApi.js +126 -4
  210. package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
  211. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +120 -11
  212. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  213. package/package.json +3 -3
@@ -0,0 +1,585 @@
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,useMemo}from'react';import {Modal,Pressable,StyleSheet,View,Text,ScrollView,KeyboardAvoidingView,TextInput,ActivityIndicator,Platform,FlatList,Animated,Switch}from'react-native';import {Ionicons}from'@expo/vector-icons';import {useLazyQuery}from'@apollo/client/index.js';import {NATIVE_NOTION_SEARCH}from'./notionDocuments.js';import {blockIcon,pageTitle}from'./notionBlocks.js';import {PAGE_FONTS}from'./notionPageActions.js';import {ui}from'./notionUi.js';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ function PageActionsSheet({
21
+ visible,
22
+ palette,
23
+ title,
24
+ subtitle,
25
+ groups,
26
+ pageSettings,
27
+ onClose
28
+ }) {
29
+ const pendingAction = useRef(null);
30
+ const flushPending = () => {
31
+ const next = pendingAction.current;
32
+ pendingAction.current = null;
33
+ next == null ? void 0 : next();
34
+ };
35
+ const run = (action) => {
36
+ pendingAction.current = action.onPress;
37
+ onClose();
38
+ setTimeout(flushPending, Platform.OS === "ios" ? 700 : 0);
39
+ };
40
+ return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, onDismiss: flushPending, children: /* @__PURE__ */ jsx(Pressable, { style: [styles.backdrop, {
41
+ backgroundColor: palette.backdrop
42
+ }], onPress: onClose, children: /* @__PURE__ */ jsxs(Pressable, { style: [styles.sheet, {
43
+ backgroundColor: palette.bg
44
+ }], children: [
45
+ /* @__PURE__ */ jsx(View, { style: [styles.grabber, {
46
+ backgroundColor: palette.hairline
47
+ }] }),
48
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.sheetTitle, {
49
+ color: palette.text
50
+ }], children: title }),
51
+ subtitle ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.sheetSubtitle, {
52
+ color: palette.textMuted
53
+ }], children: subtitle }) : null,
54
+ /* @__PURE__ */ jsxs(ScrollView, { style: styles.sheetScroll, contentContainerStyle: styles.sheetContent, children: [
55
+ pageSettings ? /* @__PURE__ */ jsx(SettingsGroup, { palette, page: pageSettings }) : null,
56
+ groups.filter((g) => g.length).map((group, gi) => /* @__PURE__ */ jsx(View, { style: [styles.group, {
57
+ backgroundColor: palette.card
58
+ }], children: group.map((a, i) => /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", onPress: () => run(a), style: ({
59
+ pressed
60
+ }) => [styles.actionRow, pressed && {
61
+ backgroundColor: palette.pressed
62
+ }], children: [
63
+ /* @__PURE__ */ jsx(Ionicons, { name: a.icon, size: 20, color: a.destructive ? palette.danger : palette.text }),
64
+ /* @__PURE__ */ jsxs(View, { style: [styles.actionBody, i < group.length - 1 && ui.hairline, {
65
+ borderBottomColor: palette.hairline
66
+ }], children: [
67
+ /* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, {
68
+ color: a.destructive ? palette.danger : palette.text
69
+ }], children: a.label }),
70
+ a.detail ? /* @__PURE__ */ jsx(Text, { style: [styles.actionDetail, {
71
+ color: palette.textMuted
72
+ }], children: a.detail }) : null
73
+ ] })
74
+ ] }, a.key)) }, gi)),
75
+ (pageSettings == null ? void 0 : pageSettings.footer) ? /* @__PURE__ */ jsx(Text, { style: [styles.footer, {
76
+ color: palette.textFaint
77
+ }], children: pageSettings.footer }) : null
78
+ ] })
79
+ ] }) }) });
80
+ }
81
+ function SettingsGroup({
82
+ palette,
83
+ page
84
+ }) {
85
+ const [local, setLocal] = useState(page.settings);
86
+ const incoming = JSON.stringify(page.settings);
87
+ useEffect(() => {
88
+ setLocal(JSON.parse(incoming));
89
+ }, [incoming]);
90
+ const toggle = (key) => {
91
+ setLocal((cur) => __spreadProps(__spreadValues({}, cur), {
92
+ [key]: !cur[key]
93
+ }));
94
+ page.onToggle(key);
95
+ };
96
+ const pickFont = (font) => {
97
+ setLocal((cur) => __spreadProps(__spreadValues({}, cur), {
98
+ font
99
+ }));
100
+ page.onFont(font);
101
+ };
102
+ const toggles = [{
103
+ key: "smallText",
104
+ label: "Small text",
105
+ icon: "text-outline"
106
+ }, {
107
+ key: "fullWidth",
108
+ label: "Full width (web)",
109
+ icon: "resize-outline"
110
+ }, {
111
+ key: "locked",
112
+ label: "Lock page",
113
+ icon: "lock-closed-outline"
114
+ }];
115
+ return /* @__PURE__ */ jsxs(View, { style: [styles.group, {
116
+ backgroundColor: palette.card
117
+ }], children: [
118
+ /* @__PURE__ */ jsx(View, { style: styles.fontRow, children: PAGE_FONTS.map((f) => {
119
+ const active = local.font === f.value;
120
+ return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", accessibilityState: {
121
+ selected: active
122
+ }, onPress: () => pickFont(f.value), style: [styles.fontChip, {
123
+ backgroundColor: active ? palette.primarySoft : palette.fill,
124
+ borderColor: active ? palette.primary : "transparent"
125
+ }], children: [
126
+ /* @__PURE__ */ jsx(Text, { style: [styles.fontSample, {
127
+ color: active ? palette.primary : palette.text,
128
+ fontFamily: fontFamilyOf(f.value)
129
+ }], children: "Ag" }),
130
+ /* @__PURE__ */ jsx(Text, { style: [styles.fontLabel, {
131
+ color: active ? palette.primary : palette.textMuted
132
+ }], children: f.label })
133
+ ] }, f.value);
134
+ }) }),
135
+ toggles.map((t, i) => /* @__PURE__ */ jsxs(View, { style: styles.actionRow, children: [
136
+ /* @__PURE__ */ jsx(Ionicons, { name: t.icon, size: 20, color: palette.text }),
137
+ /* @__PURE__ */ jsxs(View, { style: [styles.actionBody, i < toggles.length - 1 && ui.hairline, {
138
+ borderBottomColor: palette.hairline
139
+ }], children: [
140
+ /* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, {
141
+ color: palette.text
142
+ }], children: t.label }),
143
+ /* @__PURE__ */ jsx(Switch, { value: local[t.key], onValueChange: () => toggle(t.key), trackColor: {
144
+ true: palette.primary,
145
+ false: palette.fill
146
+ } })
147
+ ] })
148
+ ] }, t.key))
149
+ ] });
150
+ }
151
+ function fontFamilyOf(font) {
152
+ if (font === "serif") return Platform.OS === "ios" ? "Georgia" : "serif";
153
+ if (font === "mono") return Platform.OS === "ios" ? "Menlo" : "monospace";
154
+ return void 0;
155
+ }
156
+ function TextPromptDialog({
157
+ visible,
158
+ palette,
159
+ title,
160
+ message,
161
+ initial = "",
162
+ placeholder,
163
+ confirmLabel,
164
+ multiline,
165
+ allowEmpty,
166
+ onClose,
167
+ onConfirm
168
+ }) {
169
+ const [value, setValue] = useState(initial);
170
+ const [busy, setBusy] = useState(false);
171
+ const [error, setError] = useState(null);
172
+ useEffect(() => {
173
+ if (visible) {
174
+ setValue(initial);
175
+ setError(null);
176
+ }
177
+ }, [visible, initial]);
178
+ const canSave = !busy && (allowEmpty || Boolean(value.trim()));
179
+ const submit = async () => {
180
+ if (!canSave) return;
181
+ setBusy(true);
182
+ setError(null);
183
+ try {
184
+ await onConfirm(value);
185
+ onClose();
186
+ } catch (err) {
187
+ setError(err instanceof Error ? err.message : "Something went wrong");
188
+ } finally {
189
+ setBusy(false);
190
+ }
191
+ };
192
+ return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsx(KeyboardAvoidingView, { behavior: Platform.OS === "ios" ? "padding" : void 0, style: ui.flex, children: /* @__PURE__ */ jsx(Pressable, { style: [styles.backdrop, {
193
+ backgroundColor: palette.backdrop
194
+ }], onPress: onClose, children: /* @__PURE__ */ jsxs(Pressable, { style: [styles.sheet, {
195
+ backgroundColor: palette.card
196
+ }], children: [
197
+ /* @__PURE__ */ jsx(View, { style: [styles.grabber, {
198
+ backgroundColor: palette.hairline
199
+ }] }),
200
+ /* @__PURE__ */ jsx(Text, { style: [styles.dialogTitle, {
201
+ color: palette.text
202
+ }], children: title }),
203
+ message ? /* @__PURE__ */ jsx(Text, { style: [styles.dialogText, {
204
+ color: palette.textMuted
205
+ }], children: message }) : null,
206
+ /* @__PURE__ */ jsx(TextInput, { value, onChangeText: setValue, placeholder, placeholderTextColor: palette.textFaint, autoFocus: true, multiline, returnKeyType: multiline ? "default" : "done", onSubmitEditing: multiline ? void 0 : submit, style: [styles.dialogInput, multiline && styles.dialogInputMultiline, {
207
+ color: palette.text,
208
+ backgroundColor: palette.fill
209
+ }], textAlignVertical: multiline ? "top" : "center" }),
210
+ error ? /* @__PURE__ */ jsx(Text, { style: [styles.dialogError, {
211
+ color: palette.danger
212
+ }], children: error }) : null,
213
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: submit, disabled: !canSave, style: [ui.primaryButton, styles.blockButton, {
214
+ backgroundColor: palette.primary
215
+ }, !canSave && styles.disabled], children: busy ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.onPrimary }) : /* @__PURE__ */ jsx(Text, { style: [ui.primaryButtonLabel, {
216
+ color: palette.onPrimary
217
+ }], children: confirmLabel }) }),
218
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: onClose, style: styles.textButton, children: /* @__PURE__ */ jsx(Text, { style: [styles.textButtonLabel, {
219
+ color: palette.textMuted
220
+ }], children: "Cancel" }) })
221
+ ] }) }) }) });
222
+ }
223
+ function MoveToSheet({
224
+ visible,
225
+ palette,
226
+ pageId,
227
+ pages,
228
+ workspaceName,
229
+ workspaceId,
230
+ onClose,
231
+ onMove
232
+ }) {
233
+ const [query, setQuery] = useState("");
234
+ const [busy, setBusy] = useState(null);
235
+ const [error, setError] = useState(null);
236
+ const [search, {
237
+ data,
238
+ loading
239
+ }] = useLazyQuery(NATIVE_NOTION_SEARCH, {
240
+ fetchPolicy: "network-only"
241
+ });
242
+ useEffect(() => {
243
+ if (visible) {
244
+ setQuery("");
245
+ setError(null);
246
+ }
247
+ }, [visible]);
248
+ useEffect(() => {
249
+ const q = query.trim();
250
+ if (!q) return void 0;
251
+ const t = setTimeout(() => search({
252
+ variables: {
253
+ input: __spreadValues({
254
+ query: q,
255
+ types: ["page"],
256
+ pageSize: 30
257
+ }, workspaceId ? {
258
+ workspaceId
259
+ } : {})
260
+ }
261
+ }), 250);
262
+ return () => clearTimeout(t);
263
+ }, [query, search, workspaceId]);
264
+ const destinations = useMemo(() => {
265
+ var _a, _b;
266
+ const list = query.trim() ? (_b = (_a = data == null ? void 0 : data.searchBlocks) == null ? void 0 : _a.results) != null ? _b : [] : pages;
267
+ const seen = /* @__PURE__ */ new Set();
268
+ return list.filter((p) => {
269
+ if (!(p == null ? void 0 : p.id) || p.id === pageId || p.inTrash || p.type !== "page" || seen.has(p.id)) return false;
270
+ seen.add(p.id);
271
+ return true;
272
+ });
273
+ }, [data, pageId, pages, query]);
274
+ const move = async (to) => {
275
+ setBusy(to != null ? to : "root");
276
+ setError(null);
277
+ try {
278
+ await onMove(to);
279
+ onClose();
280
+ } catch (err) {
281
+ setError(err instanceof Error ? err.message : "Couldn't move the page");
282
+ } finally {
283
+ setBusy(null);
284
+ }
285
+ };
286
+ const row = (key, label, icon, onPress, divider) => /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", onPress, disabled: Boolean(busy), style: ({
287
+ pressed
288
+ }) => [styles.actionRow, pressed && {
289
+ backgroundColor: palette.pressed
290
+ }], children: [
291
+ icon,
292
+ /* @__PURE__ */ jsxs(View, { style: [styles.actionBody, divider && ui.hairline, {
293
+ borderBottomColor: palette.hairline
294
+ }], children: [
295
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.actionLabel, {
296
+ color: palette.text
297
+ }], children: label }),
298
+ busy === key ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.textMuted }) : null
299
+ ] })
300
+ ] }, key);
301
+ return /* @__PURE__ */ jsx(Modal, { visible, animationType: "slide", presentationStyle: "pageSheet", onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { style: [ui.flex, {
302
+ backgroundColor: palette.bg
303
+ }], children: [
304
+ /* @__PURE__ */ jsxs(View, { style: [ui.sheetHeader, {
305
+ borderBottomColor: palette.hairline
306
+ }], children: [
307
+ /* @__PURE__ */ jsx(View, { style: [ui.sheetHeaderSide, ui.sheetHeaderLeft] }),
308
+ /* @__PURE__ */ jsx(Text, { style: [ui.sheetHeaderTitle, {
309
+ color: palette.text
310
+ }], children: "Move to\u2026" }),
311
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: onClose, style: ui.sheetHeaderSide, hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: [ui.sheetHeaderDone, {
312
+ color: palette.primary
313
+ }], children: "Cancel" }) })
314
+ ] }),
315
+ /* @__PURE__ */ jsxs(View, { style: styles.moveSearch, children: [
316
+ /* @__PURE__ */ jsxs(View, { style: [styles.searchField, {
317
+ backgroundColor: palette.fill
318
+ }], children: [
319
+ /* @__PURE__ */ jsx(Ionicons, { name: "search", size: 17, color: palette.textMuted }),
320
+ /* @__PURE__ */ jsx(TextInput, { value: query, onChangeText: setQuery, placeholder: "Search for a page", placeholderTextColor: palette.textMuted, autoCorrect: false, clearButtonMode: "while-editing", style: [styles.searchInput, {
321
+ color: palette.text
322
+ }] }),
323
+ loading ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.textMuted }) : null
324
+ ] }),
325
+ error ? /* @__PURE__ */ jsx(Text, { style: [styles.dialogError, {
326
+ color: palette.danger
327
+ }], children: error }) : null
328
+ ] }),
329
+ /* @__PURE__ */ jsx(FlatList, { data: destinations, keyExtractor: (p) => p.id, keyboardShouldPersistTaps: "handled", contentContainerStyle: styles.moveList, ListHeaderComponent: /* @__PURE__ */ jsx(View, { style: [styles.group, {
330
+ backgroundColor: palette.card
331
+ }], children: row("root", `${workspaceName} (top level)`, /* @__PURE__ */ jsx(Ionicons, { name: "albums-outline", size: 20, color: palette.primary }), () => move(null), false) }), ListEmptyComponent: /* @__PURE__ */ jsx(Text, { style: [styles.hint, {
332
+ color: palette.textMuted
333
+ }], children: query.trim() ? loading ? "" : "No matching pages" : "No other pages yet" }), renderItem: ({
334
+ item,
335
+ index
336
+ }) => /* @__PURE__ */ jsx(View, { style: [{
337
+ backgroundColor: palette.card
338
+ }, index === 0 && styles.groupTop, index === destinations.length - 1 && styles.groupBottom], children: row(item.id, pageTitle(item), blockIcon(item) ? /* @__PURE__ */ jsx(Text, { style: styles.emoji, children: blockIcon(item) }) : /* @__PURE__ */ jsx(Ionicons, { name: "document-text-outline", size: 20, color: palette.textMuted }), () => move(item.id), index < destinations.length - 1) }) })
339
+ ] }) });
340
+ }
341
+ function useNotionToast() {
342
+ const [toast, setToast] = useState(null);
343
+ const timer = useRef(null);
344
+ const show = useCallback((next) => {
345
+ if (timer.current) clearTimeout(timer.current);
346
+ setToast(next);
347
+ timer.current = setTimeout(() => setToast(null), 5e3);
348
+ }, []);
349
+ const hide = useCallback(() => setToast(null), []);
350
+ useEffect(() => () => {
351
+ if (timer.current) clearTimeout(timer.current);
352
+ }, []);
353
+ return {
354
+ toast,
355
+ show,
356
+ hide
357
+ };
358
+ }
359
+ function NotionToast({
360
+ toast,
361
+ palette,
362
+ onHide
363
+ }) {
364
+ const opacity = useRef(new Animated.Value(0)).current;
365
+ useEffect(() => {
366
+ Animated.timing(opacity, {
367
+ toValue: toast ? 1 : 0,
368
+ duration: 180,
369
+ useNativeDriver: true
370
+ }).start();
371
+ }, [opacity, toast]);
372
+ if (!toast) return null;
373
+ return /* @__PURE__ */ jsx(Animated.View, { pointerEvents: "box-none", style: [styles.toastWrap, {
374
+ opacity
375
+ }], children: /* @__PURE__ */ jsxs(View, { style: [styles.toast, {
376
+ backgroundColor: palette.text
377
+ }], children: [
378
+ /* @__PURE__ */ jsx(Text, { style: [styles.toastText, {
379
+ color: palette.card
380
+ }], numberOfLines: 2, children: toast.message }),
381
+ toast.actionLabel && toast.onAction ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: () => {
382
+ var _a;
383
+ onHide();
384
+ (_a = toast.onAction) == null ? void 0 : _a.call(toast);
385
+ }, hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: [styles.toastAction, {
386
+ color: palette.primary
387
+ }], children: toast.actionLabel }) }) : null
388
+ ] }) });
389
+ }
390
+ const styles = StyleSheet.create({
391
+ backdrop: {
392
+ flex: 1,
393
+ justifyContent: "flex-end"
394
+ },
395
+ sheet: {
396
+ borderTopLeftRadius: 24,
397
+ borderTopRightRadius: 24,
398
+ paddingHorizontal: 16,
399
+ paddingTop: 8,
400
+ paddingBottom: 32,
401
+ maxHeight: "88%"
402
+ },
403
+ grabber: {
404
+ alignSelf: "center",
405
+ width: 36,
406
+ height: 5,
407
+ borderRadius: 3,
408
+ marginBottom: 12
409
+ },
410
+ sheetTitle: {
411
+ fontSize: 18,
412
+ fontWeight: "700",
413
+ marginLeft: 4
414
+ },
415
+ sheetSubtitle: {
416
+ fontSize: 13,
417
+ marginLeft: 4,
418
+ marginTop: 2
419
+ },
420
+ sheetScroll: {
421
+ marginTop: 12,
422
+ flexGrow: 0
423
+ },
424
+ sheetContent: {
425
+ gap: 12,
426
+ paddingBottom: 8
427
+ },
428
+ group: {
429
+ borderRadius: 16,
430
+ overflow: "hidden"
431
+ },
432
+ groupTop: {
433
+ borderTopLeftRadius: 16,
434
+ borderTopRightRadius: 16
435
+ },
436
+ groupBottom: {
437
+ borderBottomLeftRadius: 16,
438
+ borderBottomRightRadius: 16
439
+ },
440
+ actionRow: {
441
+ flexDirection: "row",
442
+ alignItems: "center",
443
+ paddingLeft: 16,
444
+ gap: 14
445
+ },
446
+ actionBody: {
447
+ flex: 1,
448
+ flexDirection: "row",
449
+ alignItems: "center",
450
+ gap: 8,
451
+ paddingRight: 16,
452
+ minHeight: 50
453
+ },
454
+ actionLabel: {
455
+ flex: 1,
456
+ fontSize: 16
457
+ },
458
+ actionDetail: {
459
+ fontSize: 14
460
+ },
461
+ footer: {
462
+ fontSize: 12,
463
+ textAlign: "center",
464
+ marginTop: 4
465
+ },
466
+ fontRow: {
467
+ flexDirection: "row",
468
+ gap: 8,
469
+ padding: 12
470
+ },
471
+ fontChip: {
472
+ flex: 1,
473
+ alignItems: "center",
474
+ paddingVertical: 10,
475
+ borderRadius: 12,
476
+ borderWidth: 1.5
477
+ },
478
+ fontSample: {
479
+ fontSize: 22,
480
+ fontWeight: "600"
481
+ },
482
+ fontLabel: {
483
+ fontSize: 12,
484
+ fontWeight: "600",
485
+ marginTop: 2
486
+ },
487
+ dialogTitle: {
488
+ fontSize: 20,
489
+ fontWeight: "700",
490
+ marginTop: 4
491
+ },
492
+ dialogText: {
493
+ fontSize: 14,
494
+ marginTop: 6,
495
+ lineHeight: 20
496
+ },
497
+ dialogInput: {
498
+ marginTop: 16,
499
+ fontSize: 16,
500
+ minHeight: 48,
501
+ paddingHorizontal: 14,
502
+ borderRadius: 12
503
+ },
504
+ dialogInputMultiline: {
505
+ height: 200,
506
+ paddingTop: 12
507
+ },
508
+ dialogError: {
509
+ fontSize: 13,
510
+ marginTop: 8
511
+ },
512
+ blockButton: {
513
+ alignSelf: "stretch"
514
+ },
515
+ disabled: {
516
+ opacity: 0.45
517
+ },
518
+ textButton: {
519
+ alignItems: "center",
520
+ paddingVertical: 12,
521
+ marginTop: 4
522
+ },
523
+ textButtonLabel: {
524
+ fontSize: 16,
525
+ fontWeight: "600"
526
+ },
527
+ moveSearch: {
528
+ padding: 16,
529
+ paddingBottom: 8
530
+ },
531
+ searchField: {
532
+ flexDirection: "row",
533
+ alignItems: "center",
534
+ gap: 8,
535
+ height: 40,
536
+ paddingHorizontal: 12,
537
+ borderRadius: 12
538
+ },
539
+ searchInput: {
540
+ flex: 1,
541
+ fontSize: 16,
542
+ paddingVertical: 0
543
+ },
544
+ moveList: {
545
+ paddingHorizontal: 16,
546
+ paddingBottom: 48,
547
+ gap: 0
548
+ },
549
+ hint: {
550
+ textAlign: "center",
551
+ paddingVertical: 32,
552
+ fontSize: 15
553
+ },
554
+ emoji: {
555
+ fontSize: 18,
556
+ width: 20,
557
+ textAlign: "center"
558
+ },
559
+ toastWrap: {
560
+ position: "absolute",
561
+ left: 16,
562
+ right: 16,
563
+ bottom: 32,
564
+ alignItems: "center"
565
+ },
566
+ toast: {
567
+ flexDirection: "row",
568
+ alignItems: "center",
569
+ gap: 16,
570
+ paddingHorizontal: 16,
571
+ paddingVertical: 12,
572
+ borderRadius: 14,
573
+ maxWidth: 520,
574
+ alignSelf: "stretch"
575
+ },
576
+ toastText: {
577
+ flex: 1,
578
+ fontSize: 15,
579
+ fontWeight: "500"
580
+ },
581
+ toastAction: {
582
+ fontSize: 15,
583
+ fontWeight: "800"
584
+ }
585
+ });export{MoveToSheet,NotionToast,PageActionsSheet,TextPromptDialog,fontFamilyOf,useNotionToast};//# sourceMappingURL=NotionPageMenu.js.map