@adminide-stack/yantra-mobile 12.0.137 → 12.0.139

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 (89) hide show
  1. package/lib/components/CustomDrawer.js +17 -1
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/compute.js +106 -1
  4. package/lib/compute.js.map +1 -1
  5. package/lib/config/env-config.js +12 -0
  6. package/lib/config/env-config.js.map +1 -1
  7. package/lib/features/chat/ChatTranscript.js +2 -2
  8. package/lib/features/chat/ChatTranscript.js.map +1 -1
  9. package/lib/features/chat/surfaceNotes.js +4 -0
  10. package/lib/features/chat/surfaceNotes.js.map +1 -0
  11. package/lib/features/dictate/backgroundRecording.js.map +1 -1
  12. package/lib/features/dictate/useDictationRecorder.js +42 -1
  13. package/lib/features/dictate/useDictationRecorder.js.map +1 -1
  14. package/lib/features/home/useHomeWeather.js +85 -0
  15. package/lib/features/home/useHomeWeather.js.map +1 -0
  16. package/lib/features/home/weather.js +139 -0
  17. package/lib/features/home/weather.js.map +1 -0
  18. package/lib/features/notion/NotionPageView.js +819 -0
  19. package/lib/features/notion/NotionPageView.js.map +1 -0
  20. package/lib/features/notion/NotionSheets.js +452 -0
  21. package/lib/features/notion/NotionSheets.js.map +1 -0
  22. package/lib/features/notion/NotionTrashSheet.js +415 -0
  23. package/lib/features/notion/NotionTrashSheet.js.map +1 -0
  24. package/lib/features/notion/NotionWorkspaceView.js +837 -0
  25. package/lib/features/notion/NotionWorkspaceView.js.map +1 -0
  26. package/lib/features/notion/notionBlocks.js +203 -0
  27. package/lib/features/notion/notionBlocks.js.map +1 -0
  28. package/lib/features/notion/notionDocuments.js +182 -0
  29. package/lib/features/notion/notionDocuments.js.map +1 -0
  30. package/lib/features/notion/notionEditorModel.js +180 -0
  31. package/lib/features/notion/notionEditorModel.js.map +1 -0
  32. package/lib/features/notion/notionTemplates.js +406 -0
  33. package/lib/features/notion/notionTemplates.js.map +1 -0
  34. package/lib/features/notion/notionTheme.js +34 -0
  35. package/lib/features/notion/notionTheme.js.map +1 -0
  36. package/lib/features/notion/notionTrash.js +100 -0
  37. package/lib/features/notion/notionTrash.js.map +1 -0
  38. package/lib/features/notion/notionUi.js +310 -0
  39. package/lib/features/notion/notionUi.js.map +1 -0
  40. package/lib/features/notion/useNotionWorkspace.js +181 -0
  41. package/lib/features/notion/useNotionWorkspace.js.map +1 -0
  42. package/lib/features/webbuilder/buildFragments.js +15 -9
  43. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  44. package/lib/features/webbuilder/buildJob.js +3 -3
  45. package/lib/features/webbuilder/buildJob.js.map +1 -1
  46. package/lib/features/webbuilder/publicSandboxDomain.js +5 -0
  47. package/lib/features/webbuilder/publicSandboxDomain.js.map +1 -0
  48. package/lib/features/webbuilder/sandboxPublicHost.js +74 -0
  49. package/lib/features/webbuilder/sandboxPublicHost.js.map +1 -0
  50. package/lib/features/webbuilder/siteAddress.js +2 -1
  51. package/lib/features/webbuilder/siteAddress.js.map +1 -1
  52. package/lib/features/webbuilder/webbuilderPrompts.js +3 -2
  53. package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -1
  54. package/lib/features/webbuilder/workflow.js +2 -2
  55. package/lib/features/webbuilder/workflow.js.map +1 -1
  56. package/lib/hooks/useChatApi.js +15 -3
  57. package/lib/hooks/useChatApi.js.map +1 -1
  58. package/lib/hooks/usePrerequisiteIds.js +15 -2
  59. package/lib/hooks/usePrerequisiteIds.js.map +1 -1
  60. package/lib/routes.json +107 -0
  61. package/lib/screens/Home/HomeScreen.js +20 -5
  62. package/lib/screens/Home/HomeScreen.js.map +1 -1
  63. package/lib/screens/Home/components/HomeHero.js +117 -0
  64. package/lib/screens/Home/components/HomeHero.js.map +1 -0
  65. package/lib/screens/Home/components/HomeSuggestions.js +108 -85
  66. package/lib/screens/Home/components/HomeSuggestions.js.map +1 -1
  67. package/lib/screens/Home/components/HomeWash.js +44 -0
  68. package/lib/screens/Home/components/HomeWash.js.map +1 -0
  69. package/lib/screens/Home/components/homeCatalog.js +125 -0
  70. package/lib/screens/Home/components/homeCatalog.js.map +1 -0
  71. package/lib/screens/Notion/index.js +18 -0
  72. package/lib/screens/Notion/index.js.map +1 -0
  73. package/lib/screens/NotionPage/index.js +19 -0
  74. package/lib/screens/NotionPage/index.js.map +1 -0
  75. package/lib/screens/WebBuilderNative/sandboxProxyApi.js +2 -2
  76. package/lib/screens/WebBuilderNative/sandboxProxyApi.js.map +1 -1
  77. package/lib/screens/WebBuilderNative/useRestoredSandboxes.js +16 -8
  78. package/lib/screens/WebBuilderNative/useRestoredSandboxes.js.map +1 -1
  79. package/lib/screens/WebBuilderNative/useWebBuilderGallery.js +6 -5
  80. package/lib/screens/WebBuilderNative/useWebBuilderGallery.js.map +1 -1
  81. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +5 -4
  82. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  83. package/lib/screens/WebBuilderNative/webbuilderTransport.js +4 -3
  84. package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
  85. package/lib/services/savedWorkspace.js +44 -0
  86. package/lib/services/savedWorkspace.js.map +1 -0
  87. package/lib/theme/mobileTokens.js +1 -0
  88. package/lib/theme/mobileTokens.js.map +1 -1
  89. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notionTemplates.js","sources":["../../../src/features/notion/notionTemplates.ts"],"sourcesContent":["// Ported verbatim from forms-stack packages/notion-api/browser/src/utils/pageTemplates.ts (develop).\n// Keep in sync with the web: the same templates must create the same pages on both.\n/* eslint-disable */\n/**\n * pageTemplates — page templates as PURE DATA plus the builders that turn them into\n * `createBlock` inputs (and back, for \"Save this page as template\").\n *\n * A template is a tree of blocks (`TemplateBlock`) rooted at a `page` or `database`.\n * Creating a page from it is ONE nested `createBlock` (the server's NotionCreateBlockInput\n * accepts `children` and creates them recursively, in order) plus one `createBlock` per\n * database row — rows must be parented `{ type: 'database', id }` (that's what\n * queryDatabase matches on), which the nested create can't express (it always parents\n * children as `{ type: 'block' }`). Every block gets a client-generated id up front so the\n * rows can point at their database before it exists on the server.\n *\n * Text tokens: `{{date}}` (e.g. \"Oct 7, 2026\") and `{{isoDate}}` (\"2026-10-07\") inside any\n * rich-text title / string property are replaced at creation time, so \"Journal — {{date}}\"\n * becomes \"Journal — Oct 7, 2026\".\n *\n * User templates live as ordinary pages under a flagged \"Templates\" library page at the\n * workspace root (the server has no template store): see TEMPLATE_LIBRARY_FLAG.\n */\n\n// ============================================================================\n// TYPES\n// ============================================================================\n\nexport interface TemplateBlock {\n type: string;\n properties?: Record<string, unknown>;\n children?: TemplateBlock[];\n /** Database only: rows (`database_row`), created with a `{ type: 'database' }` parent. */\n rows?: TemplateBlock[];\n}\n\nexport type TemplateCategory = 'work' | 'personal' | 'engineering';\n\nexport interface PageTemplate {\n id: string;\n name: string;\n description: string;\n icon: string;\n category: TemplateCategory | 'mine';\n /** Root block: a `page` (blocks in `children`) or a `database` (schema + rows). */\n root: TemplateBlock;\n /** For user templates: the library page block the template was read from. */\n sourceBlockId?: string;\n}\n\n/** Shape the server's `NotionCreateBlockInput` takes (children nested). */\nexport interface CreateBlockInputTree {\n id: string;\n type: string;\n properties: Record<string, unknown>;\n parent: { type: string; id: string };\n position?: string;\n children?: CreateBlockInputTree[];\n}\n\nexport interface TemplateCreatePlan {\n rootId: string;\n rootType: string;\n /** One nested createBlock for the root and all its descendants. */\n root: CreateBlockInputTree;\n /** Database rows, created after `root` (in order), each parented to its database. */\n rows: CreateBlockInputTree[];\n /** Total number of blocks the plan creates (root + descendants + rows). */\n blockCount: number;\n}\n\nexport interface TemplateBuildOptions {\n /** Id generator (tests pass a deterministic one). Default: crypto.randomUUID. */\n newId?: () => string;\n /** \"Now\", for the {{date}} tokens. */\n now?: Date;\n /** Override the root page title (e.g. \"Untitled\" → keep the template's own title when unset). */\n title?: string;\n}\n\n/** Flag on the hidden library page that holds user templates (`properties.notesTemplateLibrary`). */\nexport const TEMPLATE_LIBRARY_FLAG = 'notesTemplateLibrary';\n/** Marker copied onto user templates (`properties.notesTemplate`) — description lives here too. */\nexport const TEMPLATE_MARKER = 'notesTemplate';\n\n// ============================================================================\n// RICH TEXT + BLOCK HELPERS (data authoring)\n// ============================================================================\n\ntype Annotations = { bold?: boolean; italic?: boolean; code?: boolean };\n\nexport function rt(text: string, annotations: Annotations = {}): Record<string, unknown> {\n return { type: 'text', text: { content: text }, plainText: text, annotations };\n}\n\nconst title = (text: string | Record<string, unknown>[]) => (typeof text === 'string' ? [rt(text)] : text);\n\nconst block =\n (type: string) =>\n (text: string | Record<string, unknown>[], extra: Record<string, unknown> = {}): TemplateBlock => ({\n type,\n properties: { title: title(text), ...extra },\n });\n\nconst p = block('paragraph');\nconst h1 = block('heading_1');\nconst h2 = block('heading_2');\nconst h3 = block('heading_3');\nconst bullet = block('bulleted_list');\nconst numbered = block('numbered_list');\nconst quote = block('quote');\nconst todo = (text: string, checked = false): TemplateBlock => block('todo')(text, { checked });\nconst callout = (text: string, emoji: string): TemplateBlock => block('callout')(text, { icon: { emoji } });\nconst toggle = (text: string, children: TemplateBlock[]): TemplateBlock => ({ ...block('toggle')(text), children });\nconst code = (text: string, language = 'plain text'): TemplateBlock => block('code')(text, { language });\nconst divider = (): TemplateBlock => ({ type: 'divider', properties: {} });\nconst page = (name: string, emoji: string, children: TemplateBlock[]): TemplateBlock => ({\n type: 'page',\n properties: { title: title(name), icon: { type: 'emoji', emoji } },\n children,\n});\n\n// ============================================================================\n// BUILT-IN TEMPLATES\n// ============================================================================\n\nexport const BUILT_IN_TEMPLATES: PageTemplate[] = [\n {\n id: 'meeting-notes',\n name: 'Meeting notes',\n description: 'Agenda, notes, decisions and action items for any meeting.',\n icon: '📝',\n category: 'work',\n root: page('Meeting notes — {{date}}', '📝', [\n callout('Date: {{date}} · Attendees: @someone, @someone else', '🗓️'),\n h2('Agenda'),\n numbered('Topic one'),\n numbered('Topic two'),\n h2('Notes'),\n p(''),\n h2('Decisions'),\n bullet(''),\n h2('Action items'),\n todo('Owner — task — due date'),\n todo(''),\n ]),\n },\n {\n id: 'project-brief',\n name: 'Project brief',\n description: 'One page to align on the problem, goals, scope and milestones.',\n icon: '🎯',\n category: 'work',\n root: page('Project brief', '🎯', [\n callout('Status: Draft · Owner: you · Last updated {{date}}', '📌'),\n h2('Problem'),\n p('What problem are we solving, and for whom? Why now?'),\n h2('Goals'),\n bullet('Goal one — how we will measure it'),\n bullet('Goal two'),\n h2('Non-goals'),\n bullet('What this project will deliberately not do'),\n h2('Scope'),\n toggle('In scope', [bullet('')]),\n toggle('Out of scope', [bullet('')]),\n h2('Milestones'),\n {\n type: 'table',\n properties: {\n rows: [\n ['Milestone', 'Owner', 'Target date'],\n ['Kick-off', '', ''],\n ['Beta', '', ''],\n ['Launch', '', ''],\n ],\n },\n },\n h2('Risks & open questions'),\n bullet(''),\n ]),\n },\n {\n id: 'weekly-plan',\n name: 'Weekly plan',\n description: 'Top priorities and a day-by-day plan for the week.',\n icon: '🗓️',\n category: 'personal',\n root: page('Week of {{date}}', '🗓️', [\n h2('Top 3 priorities'),\n todo(''),\n todo(''),\n todo(''),\n divider(),\n ...['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'].map((day) => toggle(day, [todo('')])),\n toggle('Weekend', [todo('')]),\n divider(),\n h2('Reflection'),\n p('What went well? What will I change next week?'),\n ]),\n },\n {\n id: 'todo-list',\n name: 'To-do list',\n description: 'A simple checklist grouped by urgency.',\n icon: '✅',\n category: 'personal',\n root: page('To-do list', '✅', [\n h3('Today'),\n todo(''),\n h3('This week'),\n todo(''),\n h3('Later'),\n todo(''),\n h3('Done'),\n todo('Create a to-do list', true),\n ]),\n },\n {\n id: 'reading-list',\n name: 'Reading list',\n description: 'A database of books and articles with status, rating and type.',\n icon: '📚',\n category: 'personal',\n root: {\n type: 'database',\n properties: {\n title: title('Reading list'),\n icon: { type: 'emoji', emoji: '📚' },\n schema: {\n title: { type: 'title' },\n Author: { type: 'text' },\n Type: {\n type: 'select',\n options: [\n { name: 'Book', color: 'blue' },\n { name: 'Article', color: 'purple' },\n { name: 'Paper', color: 'orange' },\n ],\n },\n Status: {\n type: 'select',\n options: [\n { name: 'Want to read', color: 'gray' },\n { name: 'Reading', color: 'yellow' },\n { name: 'Finished', color: 'green' },\n ],\n },\n Rating: { type: 'number' },\n Link: { type: 'url' },\n },\n },\n rows: [\n {\n type: 'database_row',\n properties: {\n title: title('Designing Data-Intensive Applications'),\n Author: 'Martin Kleppmann',\n Type: { name: 'Book' },\n Status: { name: 'Reading' },\n },\n },\n {\n type: 'database_row',\n properties: {\n title: title('The Pragmatic Programmer'),\n Author: 'Hunt & Thomas',\n Type: { name: 'Book' },\n Status: { name: 'Want to read' },\n },\n },\n {\n type: 'database_row',\n properties: {\n title: title('Out of the Tar Pit'),\n Author: 'Moseley & Marks',\n Type: { name: 'Paper' },\n Status: { name: 'Finished' },\n Rating: 5,\n },\n },\n ],\n },\n },\n {\n id: 'journal-entry',\n name: 'Journal entry',\n description: 'A daily page for gratitude, highlights and reflection.',\n icon: '📓',\n category: 'personal',\n root: page('Journal — {{date}}', '📓', [\n quote('How am I feeling today?'),\n p(''),\n h3('Grateful for'),\n bullet(''),\n h3('Highlights'),\n bullet(''),\n h3('What I learned'),\n p(''),\n h3('Tomorrow'),\n todo(''),\n ]),\n },\n {\n id: 'bug-report',\n name: 'Bug report',\n description: 'Steps to reproduce, expected vs actual behaviour, environment.',\n icon: '🐞',\n category: 'engineering',\n root: page('Bug: short description', '🐞', [\n callout('Severity: Medium · Reported {{date}} · Assignee: unassigned', '🚦'),\n h2('Summary'),\n p('One or two sentences describing the problem.'),\n h2('Steps to reproduce'),\n numbered('Go to …'),\n numbered('Click …'),\n numbered('See error'),\n h2('Expected behaviour'),\n p(''),\n h2('Actual behaviour'),\n p(''),\n h2('Environment'),\n bullet('Browser / OS:'),\n bullet('Version / commit:'),\n toggle('Logs', [code('Paste logs or a stack trace here')]),\n ]),\n },\n {\n id: 'one-on-one',\n name: '1:1 notes',\n description: 'A running agenda for one-on-one meetings.',\n icon: '🤝',\n category: 'work',\n root: page('1:1 — {{date}}', '🤝', [\n h2('Check-in'),\n p('How are things going?'),\n h2('Their topics'),\n bullet(''),\n h2('My topics'),\n bullet(''),\n h2('Feedback'),\n toggle('Things going well', [p('')]),\n toggle('Things to improve', [p('')]),\n h2('Action items'),\n todo(''),\n ]),\n },\n {\n id: 'engineering-spec',\n name: 'Technical spec',\n description: 'Context, proposal, alternatives and rollout for a design review.',\n icon: '🛠️',\n category: 'engineering',\n root: page('Technical spec', '🛠️', [\n callout('Author: you · Reviewers: · Status: Draft', '📝'),\n h1('Context'),\n p('Background and the problem this design solves.'),\n h1('Proposal'),\n p('The approach in detail. Diagrams welcome.'),\n h2('API / data model'),\n code('// interfaces, schemas, endpoints', 'typescript'),\n h1('Alternatives considered'),\n bullet(''),\n h1('Rollout & testing'),\n todo('Feature flag'),\n todo('Tests'),\n todo('Docs'),\n ]),\n },\n];\n\nexport const TEMPLATE_CATEGORIES: Array<{ id: TemplateCategory | 'mine' | 'all'; label: string }> = [\n { id: 'all', label: 'All' },\n { id: 'work', label: 'Work' },\n { id: 'personal', label: 'Personal' },\n { id: 'engineering', label: 'Engineering' },\n { id: 'mine', label: 'My templates' },\n];\n\n// ============================================================================\n// TOKENS\n// ============================================================================\n\nexport function templateTokens(now: Date): Record<string, string> {\n const iso = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;\n let pretty: string;\n try {\n pretty = now.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });\n } catch {\n pretty = iso;\n }\n return { date: pretty, isoDate: iso };\n}\n\nfunction fillTokens(text: string, tokens: Record<string, string>): string {\n return text.replace(/\\{\\{(\\w+)\\}\\}/g, (m, key: string) => tokens[key] ?? m);\n}\n\n/** Replace tokens in every string inside a properties value (rich text, plain strings, nested). */\nfunction fillDeep(value: unknown, tokens: Record<string, string>): unknown {\n if (typeof value === 'string') return fillTokens(value, tokens);\n if (Array.isArray(value)) return value.map((v) => fillDeep(v, tokens));\n if (value && typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) out[k] = fillDeep(v, tokens);\n return out;\n }\n return value;\n}\n\n// ============================================================================\n// BUILD (template → createBlock inputs)\n// ============================================================================\n\n/** Client-generated block id (the server accepts `input.id` on createBlock). */\nexport function newBlockId(): string {\n const c = (globalThis as { crypto?: { randomUUID?: () => string } }).crypto;\n if (c?.randomUUID) return c.randomUUID();\n // RFC4122-ish fallback (non-crypto environments only).\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (ch) => {\n const r = (Math.random() * 16) | 0;\n return (ch === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\n/**\n * Turn a template into the createBlock calls that materialise it under `parent`.\n * `parent` is the workspace root (`{ type: 'workspace', id }`) or a page (`{ type: 'block', id }`).\n */\nexport function buildTemplateCreatePlan(\n template: Pick<PageTemplate, 'root'>,\n parent: { type: 'workspace' | 'block'; id: string },\n opts: TemplateBuildOptions = {},\n): TemplateCreatePlan {\n const newId = opts.newId ?? newBlockId;\n const tokens = templateTokens(opts.now ?? new Date());\n const rows: CreateBlockInputTree[] = [];\n let blockCount = 0;\n\n const build = (node: TemplateBlock, parentRef: { type: string; id: string }): CreateBlockInputTree => {\n const id = newId();\n blockCount += 1;\n const properties = (fillDeep(node.properties ?? {}, tokens) as Record<string, unknown>) ?? {};\n const out: CreateBlockInputTree = { id, type: node.type, properties, parent: parentRef };\n const kids = (node.children ?? []).map((c) => build(c, { type: 'block', id }));\n if (kids.length) out.children = kids;\n if (node.type === 'database')\n for (const row of node.rows ?? []) rows.push(build(row, { type: 'database', id }));\n return out;\n };\n\n const root = build(template.root, parent);\n if (opts.title !== undefined && opts.title.trim())\n root.properties = { ...root.properties, title: [rt(opts.title.trim())] };\n // A template's own \"this is a template\" marker must not leak into pages made from it.\n if (TEMPLATE_MARKER in root.properties) {\n const { [TEMPLATE_MARKER]: _drop, ...rest } = root.properties;\n root.properties = rest;\n }\n return { rootId: root.id, rootType: root.type, root, rows, blockCount };\n}\n\n// ============================================================================\n// SAVE AS TEMPLATE (fetched block tree → template)\n// ============================================================================\n\n/** A block tree as the API returns it (`getBlockTree`: `{ block, children }`). */\nexport interface FetchedTree {\n block: { id?: string; type: string; properties?: Record<string, unknown> | null; inTrash?: boolean | null };\n children?: FetchedTree[] | null;\n}\n\n/** Volatile / per-instance keys never copied into a template. */\nconst NON_TEMPLATE_KEYS = new Set([TEMPLATE_LIBRARY_FLAG, 'pageSettings']);\n\nfunction cleanProperties(props: Record<string, unknown> | null | undefined): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(props ?? {})) if (!NON_TEMPLATE_KEYS.has(k)) out[k] = v;\n return JSON.parse(JSON.stringify(out));\n}\n\n/**\n * Convert a fetched page tree into a template root (skips trashed blocks). `rowsByDatabase`\n * supplies database rows (getBlockTree doesn't return them: rows aren't in `content`).\n */\nexport function templateRootFromTree(\n tree: FetchedTree,\n rowsByDatabase: Record<string, Array<{ type: string; properties?: Record<string, unknown> | null }>> = {},\n): TemplateBlock {\n const convert = (node: FetchedTree): TemplateBlock => {\n const out: TemplateBlock = { type: node.block.type, properties: cleanProperties(node.block.properties) };\n // Rows come from `rowsByDatabase` only (some backends also list them as children).\n const kids = (node.children ?? [])\n .filter((c) => !c.block.inTrash && c.block.type !== 'database_row')\n .map(convert);\n if (kids.length) out.children = kids;\n const id = node.block.id;\n if (node.block.type === 'database' && id && rowsByDatabase[id]?.length)\n out.rows = rowsByDatabase[id].map((r) => ({\n type: 'database_row',\n properties: cleanProperties(r.properties),\n }));\n return out;\n };\n return convert(tree);\n}\n\n/** Ids of every database in a fetched tree (to fetch their rows before saving a template). */\nexport function databaseIdsInTree(tree: FetchedTree): string[] {\n const out: string[] = [];\n const walk = (n: FetchedTree) => {\n if (n.block.type === 'database' && n.block.id) out.push(n.block.id);\n (n.children ?? []).forEach(walk);\n };\n walk(tree);\n return out;\n}\n\n/** Number of blocks in a template (root + descendants + rows) — for previews and limits. */\nexport function countTemplateBlocks(node: TemplateBlock): number {\n return (\n 1 +\n (node.children ?? []).reduce((n, c) => n + countTemplateBlocks(c), 0) +\n (node.rows ?? []).reduce((n, r) => n + countTemplateBlocks(r), 0)\n );\n}\n\n// ============================================================================\n// PREVIEW + LOOKUP\n// ============================================================================\n\nexport function plainText(value: unknown): string {\n if (typeof value === 'string') return value;\n if (!Array.isArray(value)) return '';\n return value\n .map((r: { plainText?: string; text?: { content?: string } }) => r?.plainText ?? r?.text?.content ?? '')\n .join('');\n}\n\nexport interface TemplateOutlineLine {\n depth: number;\n type: string;\n text: string;\n checked?: boolean;\n}\n\n/** Flat outline of a template's blocks (for the picker's preview pane). Tokens are filled. */\nexport function templateOutline(tpl: Pick<PageTemplate, 'root'>, now = new Date(), max = 40): TemplateOutlineLine[] {\n const tokens = templateTokens(now);\n const out: TemplateOutlineLine[] = [];\n const walk = (nodes: TemplateBlock[] | undefined, depth: number) => {\n for (const n of nodes ?? []) {\n if (out.length >= max) return;\n out.push({\n depth,\n type: n.type,\n text: fillTokens(plainText(n.properties?.title), tokens),\n ...(n.type === 'todo' ? { checked: n.properties?.checked === true } : {}),\n });\n walk(n.children, depth + 1);\n }\n };\n if (tpl.root.type === 'database') {\n walk(tpl.root.rows, 0);\n } else {\n walk(tpl.root.children, 0);\n }\n return out;\n}\n\n/** Title the created page will get (tokens filled). */\nexport function templateTitle(tpl: Pick<PageTemplate, 'root'>, now = new Date()): string {\n return fillTokens(plainText(tpl.root.properties?.title), templateTokens(now)).trim() || 'Untitled';\n}\n\n/** Filter templates by category and a search query (name / description). */\nexport function filterTemplates(templates: readonly PageTemplate[], category: string, query: string): PageTemplate[] {\n const q = query.trim().toLowerCase();\n return templates.filter(\n (t) =>\n (category === 'all' || !category || t.category === category) &&\n (!q || t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q)),\n );\n}\n\n/** A user template (library child page/database) as a picker entry. */\nexport function userTemplateEntry(block: {\n id: string;\n type: string;\n properties?: Record<string, unknown> | null;\n}): PageTemplate {\n const props = block.properties ?? {};\n const marker = props[TEMPLATE_MARKER] as { description?: string } | undefined;\n const icon = (props.icon as { emoji?: string } | undefined)?.emoji;\n return {\n id: `user:${block.id}`,\n name: plainText(props.title).trim() || 'Untitled',\n description: marker?.description || 'Saved from one of your pages.',\n icon: icon || (block.type === 'database' ? '🗃️' : '📄'),\n category: 'mine',\n // Content is fetched on use (the library page's tree); the root here is only a stub.\n root: { type: block.type, properties: cleanProperties(props) },\n sourceBlockId: block.id,\n };\n}\n\n/** Is this block the hidden user-template library page? */\nexport function isTemplateLibrary(properties: Record<string, unknown> | null | undefined): boolean {\n return !!properties && properties[TEMPLATE_LIBRARY_FLAG] === true;\n}\n"],"names":["_a","_b","_c","block"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EO,MAAM,qBAAwB,GAAA;AAE9B,MAAM,eAAkB,GAAA;AAWxB,SAAS,EAAG,CAAA,IAAA,EAAc,WAA2B,GAAA,EAA6B,EAAA;AACvF,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,IAAM,EAAA;AAAA,MACJ,OAAS,EAAA;AAAA,KACX;AAAA,IACA,SAAW,EAAA,IAAA;AAAA,IACX;AAAA,GACF;AACF;AACA,MAAM,KAAA,GAAQ,CAAC,IAAA,KAA6C,OAAO,IAAA,KAAS,WAAW,CAAC,EAAA,CAAG,IAAI,CAAC,CAAI,GAAA,IAAA;AACpG,MAAM,QAAQ,CAAC,IAAA,KAAiB,CAAC,IAA0C,EAAA,KAAA,GAAiC,EAAuB,MAAA;AAAA,EACjI,IAAA;AAAA,EACA,UAAY,EAAA,cAAA,CAAA;AAAA,IACV,KAAA,EAAO,MAAM,IAAI;AAAA,GACd,EAAA,KAAA;AAEP,CA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AAA,GAAA,CAAQ,EAAM,GAAA,KAAA,CAAA,IAAA,KAAN,IAEE,GAAA,MAAA,GAAA,EAAA,CAAA,KAAA;AAChB,EAAO,OAAA;AAAA,IACL,EAAA,EAAI,CAAQA,KAAAA,EAAAA,MAAAA,CAAM,EAAE,CAAA,CAAA;AAAA,IACpB,MAAM,SAAU,CAAA,KAAA,CAAM,KAAK,CAAA,CAAE,MAAU,IAAA,UAAA;AAAA,IACvC,WAAA,EAAA,CAAa,iCAAQ,WAAe,KAAA,+BAAA;AAAA,IACpC,IAAM,EAAA,IAAA,KAASA,MAAM,CAAA,IAAA,KAAS,aAAa,iBAAQ,GAAA,WAAA,CAAA;AAAA,IACnD,QAAU,EAAA,MAAA;AAAA;AAAA,IAEV,IAAM,EAAA;AAAA,MACJ,MAAMA,MAAM,CAAA,IAAA;AAAA,MACZ,UAAA,EAAY,gBAAgB,KAAK;AAAA,KACnC;AAAA,IACA,eAAeA,MAAM,CAAA;AAAA,GACvB;AACF;AAGO,SAAS,kBAAkB,UAAiE,EAAA;AACjG,EAAA,OAAO,CAAC,CAAC,UAAc,IAAA,UAAA,CAAW,qBAAqB,CAAM,KAAA,IAAA;AAC/D"}
@@ -0,0 +1,34 @@
1
+ import {mobileColors}from'../../theme/mobileTokens.js';function notionPalette(isDark) {
2
+ const app = mobileColors(isDark);
3
+ return isDark ? {
4
+ bg: "#0b1220",
5
+ card: "#111a2e",
6
+ fill: "rgba(148,163,184,0.12)",
7
+ pressed: "rgba(148,163,184,0.18)",
8
+ hairline: "rgba(148,163,184,0.18)",
9
+ text: "#f1f5f9",
10
+ textMuted: "#94a3b8",
11
+ textFaint: "#64748b",
12
+ primary: app.primary,
13
+ primarySoft: "rgba(251,146,60,0.16)",
14
+ onPrimary: "#ffffff",
15
+ danger: app.dangerText,
16
+ dangerSoft: app.dangerSoft,
17
+ backdrop: "rgba(2,6,23,0.6)"
18
+ } : {
19
+ bg: "#f7f7f5",
20
+ card: "#ffffff",
21
+ fill: "#efefed",
22
+ pressed: "#ececea",
23
+ hairline: "#e7e5e4",
24
+ text: "#1c1917",
25
+ textMuted: "#78716c",
26
+ textFaint: "#a8a29e",
27
+ primary: app.primary,
28
+ primarySoft: "#fff1e6",
29
+ onPrimary: "#ffffff",
30
+ danger: app.dangerText,
31
+ dangerSoft: app.dangerSoft,
32
+ backdrop: "rgba(28,25,23,0.4)"
33
+ };
34
+ }export{notionPalette};//# sourceMappingURL=notionTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notionTheme.js","sources":["../../../src/features/notion/notionTheme.ts"],"sourcesContent":["/** Shared look of the native Notion screens (workspace + page viewer). */\nimport { mobileColors } from '../../theme/mobileTokens';\n\n/**\n * Notion-style neutral surfaces: the app tokens' orange border reads as noise\n * on a dense list, so borders and fills here are greys and the brand orange\n * marks only actions.\n */\nexport function notionPalette(isDark: boolean) {\n const app = mobileColors(isDark);\n return isDark\n ? {\n bg: '#0b1220',\n card: '#111a2e',\n fill: 'rgba(148,163,184,0.12)',\n pressed: 'rgba(148,163,184,0.18)',\n hairline: 'rgba(148,163,184,0.18)',\n text: '#f1f5f9',\n textMuted: '#94a3b8',\n textFaint: '#64748b',\n primary: app.primary,\n primarySoft: 'rgba(251,146,60,0.16)',\n onPrimary: '#ffffff',\n danger: app.dangerText,\n dangerSoft: app.dangerSoft,\n backdrop: 'rgba(2,6,23,0.6)',\n }\n : {\n bg: '#f7f7f5',\n card: '#ffffff',\n fill: '#efefed',\n pressed: '#ececea',\n hairline: '#e7e5e4',\n text: '#1c1917',\n textMuted: '#78716c',\n textFaint: '#a8a29e',\n primary: app.primary,\n primarySoft: '#fff1e6',\n onPrimary: '#ffffff',\n danger: app.dangerText,\n dangerSoft: app.dangerSoft,\n backdrop: 'rgba(28,25,23,0.4)',\n };\n}\nexport type NotionPalette = ReturnType<typeof notionPalette>;\n"],"names":[],"mappings":"uDAQO,SAAS,cAAc,MAAiB,EAAA;AAC7C,EAAM,MAAA,GAAA,GAAM,aAAa,MAAM,CAAA;AAC/B,EAAA,OAAO,MAAS,GAAA;AAAA,IACd,EAAI,EAAA,SAAA;AAAA,IACJ,IAAM,EAAA,SAAA;AAAA,IACN,IAAM,EAAA,wBAAA;AAAA,IACN,OAAS,EAAA,wBAAA;AAAA,IACT,QAAU,EAAA,wBAAA;AAAA,IACV,IAAM,EAAA,SAAA;AAAA,IACN,SAAW,EAAA,SAAA;AAAA,IACX,SAAW,EAAA,SAAA;AAAA,IACX,SAAS,GAAI,CAAA,OAAA;AAAA,IACb,WAAa,EAAA,uBAAA;AAAA,IACb,SAAW,EAAA,SAAA;AAAA,IACX,QAAQ,GAAI,CAAA,UAAA;AAAA,IACZ,YAAY,GAAI,CAAA,UAAA;AAAA,IAChB,QAAU,EAAA;AAAA,GACR,GAAA;AAAA,IACF,EAAI,EAAA,SAAA;AAAA,IACJ,IAAM,EAAA,SAAA;AAAA,IACN,IAAM,EAAA,SAAA;AAAA,IACN,OAAS,EAAA,SAAA;AAAA,IACT,QAAU,EAAA,SAAA;AAAA,IACV,IAAM,EAAA,SAAA;AAAA,IACN,SAAW,EAAA,SAAA;AAAA,IACX,SAAW,EAAA,SAAA;AAAA,IACX,SAAS,GAAI,CAAA,OAAA;AAAA,IACb,WAAa,EAAA,SAAA;AAAA,IACb,SAAW,EAAA,SAAA;AAAA,IACX,QAAQ,GAAI,CAAA,UAAA;AAAA,IACZ,YAAY,GAAI,CAAA,UAAA;AAAA,IAChB,QAAU,EAAA;AAAA,GACZ;AACF"}
@@ -0,0 +1,100 @@
1
+ import {blockIcon,blockTitle}from'./notionBlocks.js';var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ const OTHER_GROUP = "_other_";
18
+ function toTrashItem(b) {
19
+ var _a;
20
+ return __spreadValues(__spreadValues({
21
+ id: String(b.id),
22
+ type: typeof b.type === "string" && b.type ? b.type : "block",
23
+ title: blockTitle(b).trim(),
24
+ icon: blockIcon(b),
25
+ deletedTime: b.lastEditedTime || ""
26
+ }, ((_a = b.parent) == null ? void 0 : _a.id) ? {
27
+ parentId: b.parent.id
28
+ } : {}), b.rootPageId ? {
29
+ rootPageId: b.rootPageId
30
+ } : {});
31
+ }
32
+ function trashItemsOf(blocks) {
33
+ return (blocks != null ? blocks : []).filter((b) => Boolean(b && b.id)).map(toTrashItem);
34
+ }
35
+ function filterTrash(items, query) {
36
+ const q = query.trim().toLowerCase();
37
+ if (!q) return [...items];
38
+ return items.filter((i) => {
39
+ var _a;
40
+ return i.title.toLowerCase().includes(q) || ((_a = i.type) != null ? _a : "").replace(/_/g, " ").includes(q);
41
+ });
42
+ }
43
+ function blocksInDisplayOrder(blocks) {
44
+ const ids = new Set(blocks.map((b) => b.id));
45
+ const childrenByParent = /* @__PURE__ */ new Map();
46
+ blocks.forEach((b) => {
47
+ var _a;
48
+ if (!b.parentId || !ids.has(b.parentId)) return;
49
+ const list = (_a = childrenByParent.get(b.parentId)) != null ? _a : [];
50
+ list.push(b);
51
+ childrenByParent.set(b.parentId, list);
52
+ });
53
+ const out = [];
54
+ const seen = /* @__PURE__ */ new Set();
55
+ const walk = (b, depth) => {
56
+ var _a;
57
+ if (seen.has(b.id)) return;
58
+ seen.add(b.id);
59
+ out.push({
60
+ item: b,
61
+ depth
62
+ });
63
+ ((_a = childrenByParent.get(b.id)) != null ? _a : []).forEach((c) => walk(c, depth + 1));
64
+ };
65
+ blocks.filter((b) => !b.parentId || !ids.has(b.parentId)).forEach((b) => walk(b, 0));
66
+ blocks.forEach((b) => walk(b, 0));
67
+ return out;
68
+ }
69
+ function groupTrash(items, pageTitles = {}) {
70
+ const byKey = /* @__PURE__ */ new Map();
71
+ items.forEach((item) => {
72
+ var _a, _b;
73
+ const key = item.type === "page" ? item.id : (_a = item.rootPageId) != null ? _a : OTHER_GROUP;
74
+ const list = (_b = byKey.get(key)) != null ? _b : [];
75
+ list.push(item);
76
+ byKey.set(key, list);
77
+ });
78
+ const groups = [...byKey.entries()].map(([key, groupItems]) => {
79
+ var _a;
80
+ const page = key === OTHER_GROUP ? null : (_a = groupItems.find((i) => i.type === "page" && i.id === key)) != null ? _a : null;
81
+ const blocks = blocksInDisplayOrder(groupItems.filter((i) => i !== page));
82
+ let label = "Other blocks";
83
+ if (key !== OTHER_GROUP) label = pageTitles[key] || (page == null ? void 0 : page.title) || "Untitled";
84
+ return {
85
+ key,
86
+ label,
87
+ page,
88
+ blocks,
89
+ ids: groupItems.map((i) => i.id)
90
+ };
91
+ });
92
+ return groups.sort((a, b) => {
93
+ if (a.key === OTHER_GROUP) return 1;
94
+ if (b.key === OTHER_GROUP) return -1;
95
+ return a.label.localeCompare(b.label);
96
+ });
97
+ }
98
+ function pluralize(n, word) {
99
+ return `${n} ${word}${n === 1 ? "" : "s"}`;
100
+ }export{OTHER_GROUP,filterTrash,groupTrash,pluralize,toTrashItem,trashItemsOf};//# sourceMappingURL=notionTrash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notionTrash.js","sources":["../../../src/features/notion/notionTrash.ts"],"sourcesContent":["/**\n * Trash grouping, ported from the web TrashView (forms-stack notion-api/browser\n * components/TrashView + containers/TrashPage): one section per page - a trashed\n * page is its own section, a trashed block goes under the page it lived in\n * (`rootPageId`), anything else under \"Other blocks\" - with blocks in tree order.\n *\n * Pure: no RN imports, so it runs under jest as-is.\n */\nimport { blockIcon, blockTitle, type NotionBlock } from './notionBlocks';\n\nexport const OTHER_GROUP = '_other_';\n\nexport interface TrashItem {\n id: string;\n type: string;\n title: string;\n icon: string | null;\n deletedTime: string;\n parentId?: string;\n rootPageId?: string;\n}\n\nexport interface TrashGroup {\n key: string;\n label: string;\n /** The trashed page itself, when the section is a trashed page. */\n page: TrashItem | null;\n /** Blocks in display order with their nesting depth. */\n blocks: Array<{ item: TrashItem; depth: number }>;\n /** Every id in the section (page + blocks) - \"Restore all\" / \"Delete all\". */\n ids: string[];\n}\n\n/** A trash row from a listTrash block; tolerates partial records (no type / time) without crashing. */\nexport function toTrashItem(b: NotionBlock): TrashItem {\n return {\n id: String(b.id),\n type: typeof b.type === 'string' && b.type ? b.type : 'block',\n title: blockTitle(b).trim(),\n icon: blockIcon(b),\n deletedTime: b.lastEditedTime || '',\n ...(b.parent?.id ? { parentId: b.parent.id } : {}),\n ...(b.rootPageId ? { rootPageId: b.rootPageId } : {}),\n };\n}\n\n/** listTrash rows the sheet can show: anything without an id is dropped. */\nexport function trashItemsOf(blocks: readonly (NotionBlock | null | undefined)[] | null | undefined): TrashItem[] {\n return (blocks ?? []).filter((b): b is NotionBlock => Boolean(b && b.id)).map(toTrashItem);\n}\n\nexport function filterTrash(items: readonly TrashItem[], query: string): TrashItem[] {\n const q = query.trim().toLowerCase();\n if (!q) return [...items];\n return items.filter((i) => i.title.toLowerCase().includes(q) || (i.type ?? '').replace(/_/g, ' ').includes(q));\n}\n\nfunction blocksInDisplayOrder(blocks: TrashItem[]): Array<{ item: TrashItem; depth: number }> {\n const ids = new Set(blocks.map((b) => b.id));\n const childrenByParent = new Map<string, TrashItem[]>();\n blocks.forEach((b) => {\n if (!b.parentId || !ids.has(b.parentId)) return;\n const list = childrenByParent.get(b.parentId) ?? [];\n list.push(b);\n childrenByParent.set(b.parentId, list);\n });\n const out: Array<{ item: TrashItem; depth: number }> = [];\n const seen = new Set<string>();\n const walk = (b: TrashItem, depth: number) => {\n if (seen.has(b.id)) return;\n seen.add(b.id);\n out.push({ item: b, depth });\n (childrenByParent.get(b.id) ?? []).forEach((c) => walk(c, depth + 1));\n };\n blocks.filter((b) => !b.parentId || !ids.has(b.parentId)).forEach((b) => walk(b, 0));\n // Cycles / orphans: still list them so nothing is hidden.\n blocks.forEach((b) => walk(b, 0));\n return out;\n}\n\n/**\n * Sections sorted by label, \"Other blocks\" last. `pageTitles` names sections whose page is\n * not itself in the trash (a live page that lost some blocks).\n */\nexport function groupTrash(items: readonly TrashItem[], pageTitles: Record<string, string> = {}): TrashGroup[] {\n const byKey = new Map<string, TrashItem[]>();\n items.forEach((item) => {\n const key = item.type === 'page' ? item.id : (item.rootPageId ?? OTHER_GROUP);\n const list = byKey.get(key) ?? [];\n list.push(item);\n byKey.set(key, list);\n });\n const groups: TrashGroup[] = [...byKey.entries()].map(([key, groupItems]) => {\n const page = key === OTHER_GROUP ? null : (groupItems.find((i) => i.type === 'page' && i.id === key) ?? null);\n const blocks = blocksInDisplayOrder(groupItems.filter((i) => i !== page));\n let label = 'Other blocks';\n if (key !== OTHER_GROUP) label = pageTitles[key] || page?.title || 'Untitled';\n return { key, label, page, blocks, ids: groupItems.map((i) => i.id) };\n });\n return groups.sort((a, b) => {\n if (a.key === OTHER_GROUP) return 1;\n if (b.key === OTHER_GROUP) return -1;\n return a.label.localeCompare(b.label);\n });\n}\n\nexport function pluralize(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? '' : 's'}`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AASO,MAAM,WAAc,GAAA;AAyBpB,SAAS,YAAY,CAA2B,EAAA;AAlCvD,EAAA,IAAA,EAAA;AAmCE,EAAO,OAAA,cAAA,CAAA,cAAA,CAAA;AAAA,IACL,EAAA,EAAI,MAAO,CAAA,CAAA,CAAE,EAAE,CAAA;AAAA,IACf,IAAA,EAAM,OAAO,CAAE,CAAA,IAAA,KAAS,YAAY,CAAE,CAAA,IAAA,GAAO,EAAE,IAAO,GAAA,OAAA;AAAA,IAC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A,KAAA,CAAA,KAAM,IAAI,CAAC,CAAA;AACtE,IAAA,IAAI,KAAQ,GAAA,cAAA;AACZ,IAAA,IAAI,QAAQ,WAAa,EAAA,KAAA,GAAQ,WAAW,GAAG,CAAA,KAAK,6BAAM,KAAS,CAAA,IAAA,UAAA;AACnE,IAAO,OAAA;AAAA,MACL,GAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,GAAK,EAAA,UAAA,CAAW,GAAI,CAAA,CAAA,CAAA,KAAK,EAAE,EAAE;AAAA,KAC/B;AAAA,GACD,CAAA;AACD,EAAA,OAAO,MAAO,CAAA,IAAA,CAAK,CAAC,CAAA,EAAG,CAAM,KAAA;AAC3B,IAAI,IAAA,CAAA,CAAE,GAAQ,KAAA,WAAA,EAAoB,OAAA,CAAA;AAClC,IAAI,IAAA,CAAA,CAAE,GAAQ,KAAA,WAAA,EAAoB,OAAA,EAAA;AAClC,IAAA,OAAO,CAAE,CAAA,KAAA,CAAM,aAAc,CAAA,CAAA,CAAE,KAAK,CAAA;AAAA,GACrC,CAAA;AACH;AACgB,SAAA,SAAA,CAAU,GAAW,IAAsB,EAAA;AACzD,EAAO,OAAA,CAAA,EAAG,CAAC,CAAI,CAAA,EAAA,IAAI,GAAG,CAAM,KAAA,CAAA,GAAI,KAAK,GAAG,CAAA,CAAA;AAC1C"}
@@ -0,0 +1,310 @@
1
+ import {jsx,jsxs}from'react/jsx-runtime';import {StyleSheet,View,Text,Pressable,ActivityIndicator}from'react-native';import {Ionicons}from'@expo/vector-icons';import {workspaceIcon,editedLabel,pageTitle,blockIcon}from'./notionBlocks.js';function WorkspaceBadge({
2
+ workspace,
3
+ palette,
4
+ size = 36
5
+ }) {
6
+ const emoji = workspaceIcon(workspace);
7
+ return /* @__PURE__ */ jsx(View, { style: [ui.badge, {
8
+ width: size,
9
+ height: size,
10
+ borderRadius: size * 0.28,
11
+ backgroundColor: palette.primarySoft
12
+ }], children: workspace ? /* @__PURE__ */ jsx(Text, { style: [ui.badgeText, {
13
+ color: palette.primary,
14
+ fontSize: size * 0.44
15
+ }], children: emoji != null ? emoji : workspace.name.trim().charAt(0).toUpperCase() }) : /* @__PURE__ */ jsx(Ionicons, { name: "add", size: size * 0.5, color: palette.primary }) });
16
+ }
17
+ function SectionHeader({
18
+ label,
19
+ count,
20
+ palette,
21
+ action
22
+ }) {
23
+ return /* @__PURE__ */ jsxs(View, { style: ui.sectionHeader, children: [
24
+ /* @__PURE__ */ jsx(Text, { style: [ui.sectionTitle, {
25
+ color: palette.text
26
+ }], children: label }),
27
+ typeof count === "number" ? /* @__PURE__ */ jsx(Text, { style: [ui.sectionCount, {
28
+ color: palette.textFaint
29
+ }], children: count }) : null,
30
+ /* @__PURE__ */ jsx(View, { style: ui.flex }),
31
+ action ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: action.onPress, hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: [ui.sectionAction, {
32
+ color: palette.primary
33
+ }], children: action.label }) }) : null
34
+ ] });
35
+ }
36
+ function EmptyState({
37
+ palette,
38
+ icon,
39
+ title,
40
+ text,
41
+ action
42
+ }) {
43
+ return /* @__PURE__ */ jsxs(View, { style: [ui.empty, {
44
+ backgroundColor: palette.card
45
+ }, ui.cardShadow], children: [
46
+ /* @__PURE__ */ jsx(View, { style: [ui.emptyIcon, {
47
+ backgroundColor: palette.primarySoft
48
+ }], children: /* @__PURE__ */ jsx(Ionicons, { name: icon, size: 28, color: palette.primary }) }),
49
+ /* @__PURE__ */ jsx(Text, { style: [ui.emptyTitle, {
50
+ color: palette.text
51
+ }], children: title }),
52
+ /* @__PURE__ */ jsx(Text, { style: [ui.emptyText, {
53
+ color: palette.textMuted
54
+ }], children: text }),
55
+ action ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: action.onPress, disabled: action.busy, style: ({
56
+ pressed
57
+ }) => [ui.primaryButton, {
58
+ backgroundColor: palette.primary
59
+ }, pressed && ui.pressedScale], children: action.busy ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: palette.onPrimary }) : /* @__PURE__ */ jsx(Text, { style: [ui.primaryButtonLabel, {
60
+ color: palette.onPrimary
61
+ }], children: action.label }) }) : null
62
+ ] });
63
+ }
64
+ function ListRow({
65
+ palette,
66
+ icon,
67
+ emoji,
68
+ iconColor,
69
+ iconBg,
70
+ title,
71
+ subtitle,
72
+ onPress,
73
+ divider,
74
+ trailing
75
+ }) {
76
+ return /* @__PURE__ */ jsxs(Pressable, { accessibilityRole: "button", disabled: !onPress, onPress, style: ({
77
+ pressed
78
+ }) => [ui.row, pressed && {
79
+ backgroundColor: palette.pressed
80
+ }], children: [
81
+ /* @__PURE__ */ jsx(View, { style: [ui.rowIcon, {
82
+ backgroundColor: iconBg != null ? iconBg : palette.fill
83
+ }], children: emoji ? /* @__PURE__ */ jsx(Text, { style: ui.rowEmoji, children: emoji }) : /* @__PURE__ */ jsx(Ionicons, { name: icon != null ? icon : "document-text-outline", size: 18, color: iconColor != null ? iconColor : palette.textMuted }) }),
84
+ /* @__PURE__ */ jsxs(View, { style: [ui.rowBody, divider && ui.hairline, divider && {
85
+ borderBottomColor: palette.hairline
86
+ }], children: [
87
+ /* @__PURE__ */ jsxs(View, { style: ui.flex, children: [
88
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [ui.rowTitle, {
89
+ color: palette.text
90
+ }], children: title }),
91
+ subtitle ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [ui.rowSubtitle, {
92
+ color: palette.textMuted
93
+ }], children: subtitle }) : null
94
+ ] }),
95
+ trailing === void 0 ? /* @__PURE__ */ jsx(Ionicons, { name: "chevron-forward", size: 16, color: palette.textFaint }) : trailing
96
+ ] })
97
+ ] });
98
+ }
99
+ function PageRow({
100
+ page,
101
+ palette,
102
+ onPress,
103
+ divider,
104
+ trailing
105
+ }) {
106
+ return /* @__PURE__ */ jsx(ListRow, { palette, emoji: blockIcon(page), icon: page.type === "database" ? "grid-outline" : "document-text-outline", title: pageTitle(page), subtitle: editedLabel(page.lastEditedTime), onPress, divider, trailing });
107
+ }
108
+ function Group({
109
+ palette,
110
+ children
111
+ }) {
112
+ return /* @__PURE__ */ jsx(View, { style: [ui.group, {
113
+ backgroundColor: palette.card
114
+ }, ui.cardShadow], children });
115
+ }
116
+ function Pill({
117
+ label,
118
+ color,
119
+ bg
120
+ }) {
121
+ return /* @__PURE__ */ jsx(View, { style: [ui.pill, {
122
+ backgroundColor: bg
123
+ }], children: /* @__PURE__ */ jsx(Text, { style: [ui.pillText, {
124
+ color
125
+ }], children: label }) });
126
+ }
127
+ function SheetHeader({
128
+ title,
129
+ onDone,
130
+ palette,
131
+ left
132
+ }) {
133
+ return /* @__PURE__ */ jsxs(View, { style: [ui.sheetHeader, {
134
+ borderBottomColor: palette.hairline
135
+ }], children: [
136
+ /* @__PURE__ */ jsx(View, { style: [ui.sheetHeaderSide, ui.sheetHeaderLeft], children: left ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: left.onPress, disabled: left.disabled, hitSlop: 8, children: /* @__PURE__ */ jsx(Text, { style: [ui.sheetHeaderAction, {
137
+ color: left.disabled ? palette.textFaint : palette.primary
138
+ }], children: left.label }) }) : null }),
139
+ /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [ui.sheetHeaderTitle, {
140
+ color: palette.text
141
+ }], children: title }),
142
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: onDone, hitSlop: 8, style: ui.sheetHeaderSide, children: /* @__PURE__ */ jsx(Text, { style: [ui.sheetHeaderDone, {
143
+ color: palette.primary
144
+ }], children: "Done" }) })
145
+ ] });
146
+ }
147
+ const ui = StyleSheet.create({
148
+ flex: {
149
+ flex: 1
150
+ },
151
+ hairline: {
152
+ borderBottomWidth: StyleSheet.hairlineWidth
153
+ },
154
+ pressedScale: {
155
+ transform: [{
156
+ scale: 0.97
157
+ }],
158
+ opacity: 0.92
159
+ },
160
+ cardShadow: {
161
+ shadowColor: "#1c1917",
162
+ shadowOpacity: 0.05,
163
+ shadowRadius: 8,
164
+ shadowOffset: {
165
+ width: 0,
166
+ height: 2
167
+ },
168
+ elevation: 1
169
+ },
170
+ badge: {
171
+ alignItems: "center",
172
+ justifyContent: "center"
173
+ },
174
+ badgeText: {
175
+ fontWeight: "700"
176
+ },
177
+ sectionHeader: {
178
+ flexDirection: "row",
179
+ alignItems: "baseline",
180
+ gap: 8,
181
+ marginTop: 28,
182
+ marginBottom: 10
183
+ },
184
+ sectionTitle: {
185
+ fontSize: 20,
186
+ fontWeight: "700",
187
+ letterSpacing: -0.3
188
+ },
189
+ sectionCount: {
190
+ fontSize: 15,
191
+ fontWeight: "600"
192
+ },
193
+ sectionAction: {
194
+ fontSize: 15,
195
+ fontWeight: "600"
196
+ },
197
+ group: {
198
+ borderRadius: 16,
199
+ overflow: "hidden"
200
+ },
201
+ row: {
202
+ flexDirection: "row",
203
+ alignItems: "center",
204
+ paddingLeft: 14
205
+ },
206
+ rowIcon: {
207
+ width: 36,
208
+ height: 36,
209
+ borderRadius: 10,
210
+ alignItems: "center",
211
+ justifyContent: "center"
212
+ },
213
+ rowEmoji: {
214
+ fontSize: 18
215
+ },
216
+ rowBody: {
217
+ flex: 1,
218
+ flexDirection: "row",
219
+ alignItems: "center",
220
+ gap: 8,
221
+ marginLeft: 12,
222
+ paddingRight: 14,
223
+ paddingVertical: 13
224
+ },
225
+ rowTitle: {
226
+ fontSize: 16,
227
+ fontWeight: "600"
228
+ },
229
+ rowSubtitle: {
230
+ fontSize: 13,
231
+ marginTop: 2
232
+ },
233
+ pill: {
234
+ paddingHorizontal: 8,
235
+ paddingVertical: 3,
236
+ borderRadius: 999
237
+ },
238
+ pillText: {
239
+ fontSize: 12,
240
+ fontWeight: "700"
241
+ },
242
+ empty: {
243
+ alignItems: "center",
244
+ marginTop: 20,
245
+ paddingVertical: 32,
246
+ paddingHorizontal: 24,
247
+ borderRadius: 20
248
+ },
249
+ emptyIcon: {
250
+ width: 60,
251
+ height: 60,
252
+ borderRadius: 18,
253
+ alignItems: "center",
254
+ justifyContent: "center"
255
+ },
256
+ emptyTitle: {
257
+ fontSize: 18,
258
+ fontWeight: "700",
259
+ marginTop: 16,
260
+ textAlign: "center"
261
+ },
262
+ emptyText: {
263
+ fontSize: 15,
264
+ lineHeight: 21,
265
+ textAlign: "center",
266
+ marginTop: 6,
267
+ maxWidth: 280
268
+ },
269
+ primaryButton: {
270
+ marginTop: 20,
271
+ minHeight: 48,
272
+ minWidth: 160,
273
+ paddingHorizontal: 24,
274
+ borderRadius: 14,
275
+ alignItems: "center",
276
+ justifyContent: "center"
277
+ },
278
+ primaryButtonLabel: {
279
+ fontSize: 16,
280
+ fontWeight: "700"
281
+ },
282
+ sheetHeader: {
283
+ flexDirection: "row",
284
+ alignItems: "center",
285
+ paddingHorizontal: 16,
286
+ height: 56,
287
+ borderBottomWidth: StyleSheet.hairlineWidth
288
+ },
289
+ sheetHeaderSide: {
290
+ width: 72,
291
+ alignItems: "flex-end"
292
+ },
293
+ sheetHeaderLeft: {
294
+ alignItems: "flex-start"
295
+ },
296
+ sheetHeaderTitle: {
297
+ flex: 1,
298
+ textAlign: "center",
299
+ fontSize: 17,
300
+ fontWeight: "700"
301
+ },
302
+ sheetHeaderAction: {
303
+ fontSize: 16,
304
+ fontWeight: "500"
305
+ },
306
+ sheetHeaderDone: {
307
+ fontSize: 17,
308
+ fontWeight: "600"
309
+ }
310
+ });export{EmptyState,Group,ListRow,PageRow,Pill,SectionHeader,SheetHeader,WorkspaceBadge,ui};//# sourceMappingURL=notionUi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notionUi.js","sources":["../../../src/features/notion/notionUi.tsx"],"sourcesContent":["/**\n * Building blocks shared by the native Notion workspace and its sheets: page\n * rows, grouped-list chrome, empty states and the iOS-style sheet header.\n */\nimport React from 'react';\nimport { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native';\nimport { Ionicons } from '@expo/vector-icons';\nimport {\n blockIcon,\n editedLabel,\n pageTitle,\n workspaceIcon,\n type NotionBlock,\n type NotionWorkspace,\n} from './notionBlocks';\nimport type { NotionPalette } from './notionTheme';\n\nexport type IconName = React.ComponentProps<typeof Ionicons>['name'];\n\nexport function WorkspaceBadge({\n workspace,\n palette,\n size = 36,\n}: {\n workspace: NotionWorkspace | null;\n palette: NotionPalette;\n size?: number;\n}) {\n const emoji = workspaceIcon(workspace);\n return (\n <View\n style={[\n ui.badge,\n { width: size, height: size, borderRadius: size * 0.28, backgroundColor: palette.primarySoft },\n ]}\n >\n {workspace ? (\n <Text style={[ui.badgeText, { color: palette.primary, fontSize: size * 0.44 }]}>\n {emoji ?? workspace.name.trim().charAt(0).toUpperCase()}\n </Text>\n ) : (\n <Ionicons name=\"add\" size={size * 0.5} color={palette.primary} />\n )}\n </View>\n );\n}\n\nexport function SectionHeader({\n label,\n count,\n palette,\n action,\n}: {\n label: string;\n count?: number;\n palette: NotionPalette;\n action?: { label: string; onPress: () => void };\n}) {\n return (\n <View style={ui.sectionHeader}>\n <Text style={[ui.sectionTitle, { color: palette.text }]}>{label}</Text>\n {typeof count === 'number' ? (\n <Text style={[ui.sectionCount, { color: palette.textFaint }]}>{count}</Text>\n ) : null}\n <View style={ui.flex} />\n {action ? (\n <Pressable accessibilityRole=\"button\" onPress={action.onPress} hitSlop={8}>\n <Text style={[ui.sectionAction, { color: palette.primary }]}>{action.label}</Text>\n </Pressable>\n ) : null}\n </View>\n );\n}\n\nexport function EmptyState({\n palette,\n icon,\n title,\n text,\n action,\n}: {\n palette: NotionPalette;\n icon: IconName;\n title: string;\n text: string;\n action?: { label: string; onPress: () => void; busy?: boolean };\n}) {\n return (\n <View style={[ui.empty, { backgroundColor: palette.card }, ui.cardShadow]}>\n <View style={[ui.emptyIcon, { backgroundColor: palette.primarySoft }]}>\n <Ionicons name={icon} size={28} color={palette.primary} />\n </View>\n <Text style={[ui.emptyTitle, { color: palette.text }]}>{title}</Text>\n <Text style={[ui.emptyText, { color: palette.textMuted }]}>{text}</Text>\n {action ? (\n <Pressable\n accessibilityRole=\"button\"\n onPress={action.onPress}\n disabled={action.busy}\n style={({ pressed }) => [\n ui.primaryButton,\n { backgroundColor: palette.primary },\n pressed && ui.pressedScale,\n ]}\n >\n {action.busy ? (\n <ActivityIndicator size=\"small\" color={palette.onPrimary} />\n ) : (\n <Text style={[ui.primaryButtonLabel, { color: palette.onPrimary }]}>{action.label}</Text>\n )}\n </Pressable>\n ) : null}\n </View>\n );\n}\n\n/** One row of a grouped list: leading icon chip, title + subtitle, trailing accessory. */\nexport function ListRow({\n palette,\n icon,\n emoji,\n iconColor,\n iconBg,\n title,\n subtitle,\n onPress,\n divider,\n trailing,\n}: {\n palette: NotionPalette;\n icon?: IconName;\n emoji?: string | null;\n iconColor?: string;\n iconBg?: string;\n title: string;\n subtitle?: string;\n onPress?: () => void;\n divider?: boolean;\n trailing?: React.ReactNode;\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={!onPress}\n onPress={onPress}\n style={({ pressed }) => [ui.row, pressed && { backgroundColor: palette.pressed }]}\n >\n <View style={[ui.rowIcon, { backgroundColor: iconBg ?? palette.fill }]}>\n {emoji ? (\n <Text style={ui.rowEmoji}>{emoji}</Text>\n ) : (\n <Ionicons name={icon ?? 'document-text-outline'} size={18} color={iconColor ?? palette.textMuted} />\n )}\n </View>\n <View style={[ui.rowBody, divider && ui.hairline, divider && { borderBottomColor: palette.hairline }]}>\n <View style={ui.flex}>\n <Text numberOfLines={1} style={[ui.rowTitle, { color: palette.text }]}>\n {title}\n </Text>\n {subtitle ? (\n <Text numberOfLines={1} style={[ui.rowSubtitle, { color: palette.textMuted }]}>\n {subtitle}\n </Text>\n ) : null}\n </View>\n {trailing === undefined ? (\n <Ionicons name=\"chevron-forward\" size={16} color={palette.textFaint} />\n ) : (\n trailing\n )}\n </View>\n </Pressable>\n );\n}\n\nexport function PageRow({\n page,\n palette,\n onPress,\n divider,\n trailing,\n}: {\n page: NotionBlock;\n palette: NotionPalette;\n onPress?: () => void;\n divider?: boolean;\n trailing?: React.ReactNode;\n}) {\n return (\n <ListRow\n palette={palette}\n emoji={blockIcon(page)}\n icon={page.type === 'database' ? 'grid-outline' : 'document-text-outline'}\n title={pageTitle(page)}\n subtitle={editedLabel(page.lastEditedTime)}\n onPress={onPress}\n divider={divider}\n trailing={trailing}\n />\n );\n}\n\n/** Rounded white group around a run of rows. */\nexport function Group({ palette, children }: { palette: NotionPalette; children: React.ReactNode }) {\n return <View style={[ui.group, { backgroundColor: palette.card }, ui.cardShadow]}>{children}</View>;\n}\n\n/** Small count / status pill. */\nexport function Pill({ label, color, bg }: { label: string; color: string; bg: string }) {\n return (\n <View style={[ui.pill, { backgroundColor: bg }]}>\n <Text style={[ui.pillText, { color }]}>{label}</Text>\n </View>\n );\n}\n\n/** iOS-style sheet header: title centred, Done on the right, optional left action. */\nexport function SheetHeader({\n title,\n onDone,\n palette,\n left,\n}: {\n title: string;\n onDone: () => void;\n palette: NotionPalette;\n left?: { label: string; onPress: () => void; disabled?: boolean };\n}) {\n return (\n <View style={[ui.sheetHeader, { borderBottomColor: palette.hairline }]}>\n <View style={[ui.sheetHeaderSide, ui.sheetHeaderLeft]}>\n {left ? (\n <Pressable accessibilityRole=\"button\" onPress={left.onPress} disabled={left.disabled} hitSlop={8}>\n <Text\n style={[\n ui.sheetHeaderAction,\n { color: left.disabled ? palette.textFaint : palette.primary },\n ]}\n >\n {left.label}\n </Text>\n </Pressable>\n ) : null}\n </View>\n <Text numberOfLines={1} style={[ui.sheetHeaderTitle, { color: palette.text }]}>\n {title}\n </Text>\n <Pressable accessibilityRole=\"button\" onPress={onDone} hitSlop={8} style={ui.sheetHeaderSide}>\n <Text style={[ui.sheetHeaderDone, { color: palette.primary }]}>Done</Text>\n </Pressable>\n </View>\n );\n}\n\nexport const ui = StyleSheet.create({\n flex: { flex: 1 },\n hairline: { borderBottomWidth: StyleSheet.hairlineWidth },\n pressedScale: { transform: [{ scale: 0.97 }], opacity: 0.92 },\n cardShadow: {\n shadowColor: '#1c1917',\n shadowOpacity: 0.05,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 2 },\n elevation: 1,\n },\n badge: { alignItems: 'center', justifyContent: 'center' },\n badgeText: { fontWeight: '700' },\n\n sectionHeader: { flexDirection: 'row', alignItems: 'baseline', gap: 8, marginTop: 28, marginBottom: 10 },\n sectionTitle: { fontSize: 20, fontWeight: '700', letterSpacing: -0.3 },\n sectionCount: { fontSize: 15, fontWeight: '600' },\n sectionAction: { fontSize: 15, fontWeight: '600' },\n\n group: { borderRadius: 16, overflow: 'hidden' },\n row: { flexDirection: 'row', alignItems: 'center', paddingLeft: 14 },\n rowIcon: { width: 36, height: 36, borderRadius: 10, alignItems: 'center', justifyContent: 'center' },\n rowEmoji: { fontSize: 18 },\n rowBody: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n marginLeft: 12,\n paddingRight: 14,\n paddingVertical: 13,\n },\n rowTitle: { fontSize: 16, fontWeight: '600' },\n rowSubtitle: { fontSize: 13, marginTop: 2 },\n\n pill: { paddingHorizontal: 8, paddingVertical: 3, borderRadius: 999 },\n pillText: { fontSize: 12, fontWeight: '700' },\n\n empty: { alignItems: 'center', marginTop: 20, paddingVertical: 32, paddingHorizontal: 24, borderRadius: 20 },\n emptyIcon: { width: 60, height: 60, borderRadius: 18, alignItems: 'center', justifyContent: 'center' },\n emptyTitle: { fontSize: 18, fontWeight: '700', marginTop: 16, textAlign: 'center' },\n emptyText: { fontSize: 15, lineHeight: 21, textAlign: 'center', marginTop: 6, maxWidth: 280 },\n primaryButton: {\n marginTop: 20,\n minHeight: 48,\n minWidth: 160,\n paddingHorizontal: 24,\n borderRadius: 14,\n alignItems: 'center',\n justifyContent: 'center',\n },\n primaryButtonLabel: { fontSize: 16, fontWeight: '700' },\n\n sheetHeader: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: 16,\n height: 56,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n sheetHeaderSide: { width: 72, alignItems: 'flex-end' },\n sheetHeaderLeft: { alignItems: 'flex-start' },\n sheetHeaderTitle: { flex: 1, textAlign: 'center', fontSize: 17, fontWeight: '700' },\n sheetHeaderAction: { fontSize: 16, fontWeight: '500' },\n sheetHeaderDone: { fontSize: 17, fontWeight: '600' },\n});\n"],"names":[],"mappings":"6OAUO,SAAS,cAAe,CAAA;AAAA,EAC7B,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAO,GAAA;AACT,CAIG,EAAA;AACD,EAAM,MAAA,KAAA,GAAQ,cAAc,SAAS,CAAA;AACrC,EAAA,uBAAQ,GAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA,CAAC,GAAG,KAAO,EAAA;AAAA,IAC7B,KAAO,EAAA,IAAA;AAAA,IACP,MAAQ,EAAA,IAAA;AAAA,IACR,cAAc,IAAO,GAAA,IAAA;AAAA,IACrB,iBAAiB,OAAQ,CAAA;AAAA,GAC1B,GACU,QAAY,EAAA,SAAA,mBAAA,GAAA,CAAC,QAAK,KAAO,EAAA,CAAC,GAAG,SAAW,EAAA;AAAA,IAC/C,OAAO,OAAQ,CAAA,OAAA;AAAA,IACf,UAAU,IAAO,GAAA;AAAA,GAClB,GACgB,QAAS,EAAA,KAAA,IAAA,IAAA,GAAA,KAAA,GAAA,SAAA,CAAU,KAAK,IAAK,EAAA,CAAE,MAAO,CAAA,CAAC,CAAE,CAAA,WAAA,IAC9C,CAAU,mBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,IAAA,EAAK,KAAM,EAAA,IAAA,EAAM,OAAO,GAAK,EAAA,KAAA,EAAO,OAAQ,CAAA,OAAA,EAAS,CACjF,EAAA,CAAA;AACR;AACO,SAAS,aAAc,CAAA;AAAA,EAC5B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAQG,EAAA;AACD,EAAA,uBAAQ,IAAA,CAAA,IAAA,EAAA,EAAK,KAAO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