diff --git a/examples/getting-started/vanilla/index.html b/examples/getting-started/vanilla/index.html index 1d5401ef6..204513a45 100644 --- a/examples/getting-started/vanilla/index.html +++ b/examples/getting-started/vanilla/index.html @@ -10,6 +10,7 @@

SuperDoc Example

+ { console.log('Editor is created', event); + + // Get page count after editor is created + setTimeout(() => { + const documents = editor.superdocStore.documents; + const presentationEditor = documents[0]?.getPresentationEditor(); + + if (presentationEditor) { + const pages = presentationEditor.getPages(); + const pageCount = pages.length; + console.log(`Document has ${pageCount} page(s)`); + + // Display page count in UI + const pageCountDisplay = document.getElementById('pageCount'); + if (pageCountDisplay) { + pageCountDisplay.textContent = `Pages: ${pageCount}`; + } + } + }, 100); // Small delay to ensure layout is complete }, }); } diff --git a/examples/getting-started/vanilla/wrangler.toml b/examples/getting-started/vanilla/wrangler.toml new file mode 100644 index 000000000..3a8855914 --- /dev/null +++ b/examples/getting-started/vanilla/wrangler.toml @@ -0,0 +1,21 @@ +name = "superdoc-page-count" +compatibility_date = "2023-12-01" + +[env.production] +account_id = "" +zone_id = "" + +# Pages configuration +pages_build_output_dir = "dist" + +# Build configuration +[build] +command = "npm run build" +cwd = "" + +# Environment variables (if needed) +[vars] + +# Custom domains (optional) +[env.production.routes] +# Add custom domains here if needed \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 936df5bdc..94688641d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,7 +76,7 @@ catalogs: specifier: ^4.4.4 version: 4.4.4 eslint-plugin-import-x: - specifier: ^4.16.1 + specifier: 4.16.1 version: 4.16.1 eslint-plugin-jsdoc: specifier: ^54.1.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 50979a061..8d1e0238b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -29,7 +29,7 @@ catalog: eslint: ^9.39.1 eslint-config-prettier: ^9.1.0 eslint-import-resolver-typescript: ^4.4.4 - eslint-plugin-import-x: ^4.16.1 + eslint-plugin-import-x: 4.16.1 eslint-plugin-jsdoc: ^54.1.0 eventemitter3: ^5.0.1 he: ^1.2.0