Repository navigation
feat(examples): Zotero / BibTeX citation web plugin sample (dev-board#1956) - #1959
Merged
Merged
Conversation
…#1956) Sandboxed web plugin sample: reads a project .bib file or Zotero CSL-JSON export through awd.files, searches by author/year/title (field prefixes, accent-insensitive), and inserts an in-text, APA or Chicago author-date citation at the cursor through awd.doc.insertText (tracked change). Styles use only host --awd-* tokens and SDK component classes; every UI string is a key in l10n/en-US.json and l10n/zh-CN.json, mirrored into web/l10n.js by scripts/build-l10n.mjs because the sandbox CSP blocks fetch. 20 offline tests (parser, search, formatting, l10n parity, no literal text or colours, JSDOM panel with a stub host bridge) run in the frontend CI step; the SDK copy joins the distributed-copies parity list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (CodeQL) CodeQL flagged the regex-based comment/script/style stripping in the zotero-bibtex-web-plugin l10n test (js/incomplete-multi-character-sanitization, js/bad-tag-filter). Same check, indexOf scanner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sandboxed web plugin sample
examples/zotero-bibtex-web-plugin/(pattern ofexamples/hello-web-plugin/). Sample only: not added to the marketplace, the official plugin set or any release..bib/.jsonfiles (awd.files.list), reads one (awd.files.read), parses BibTeX (@stringmacros, month macros,#concatenation, LaTeX accents,vonparticles, braced corporate authors; malformed entries skipped) or Zotero CSL-JSON.author:/year:/title:prefixes; accent-insensitive.(Author, Year), APA 7 reference or Chicago author-date reference and inserts it at the cursor viaawd.doc.insertText(tracked change). Last library and style kept inawd.storage;files.changedrefreshes the list; host errors become readable messages.file_read+editoronly (nonetwork).--awd-*tokens and SDKawd-*classes, no colour literals (test-enforced).l10n/en-US.json+l10n/zh-CN.json(the plugin l10n pair of spec §14.4 / hello-declarative-plugin). The sandbox CSP blocks fetch, soscripts/build-l10n.mjsgeneratesweb/l10n.js; a test fails if they drift.sdk/plugin-sdk/tests/platform.test.mjs.Tests
node --test examples/zotero-bibtex-web-plugin/tests/*.test.mjs: 20/20, offline (parser, search, formats, l10n parity and mirror, no literal text/Han/colours in markup, JSDOM panel with a stub host bridge incl. XSS-as-text).citations.jsstubbed and a literal string + hex colour injected intoindex.html, 10 of 16 fail; panel test fails when insert sends the wrong text or renders via innerHTML.desktop/tests/test-reachability.test.js: red without the CI line, green with it.sdk-parity, check-spdx, check-palette, check-design-system, check-ui-hygiene, check-tool-parity,npm run check:locales,plugin-dev validate, gitleaks: clean.Not verified: the panel inside a running host with a real Word document (JSDOM with a stub bridge only).
🤖 Generated with Claude Code