Skip to content
QuireKit
Core docs
Alpha · evolving API
Build a productView Markdown ↗

Add product features to Classic

Distinguish content extensions from interface plugins, then add actions, sidebars and file services.

The note group changes document content. Toolbars, sidebars and file menus belong to product plugins. This chapter reuses Classic's interface and adds “My product” and a product inspector.

A custom workspace can compose its own components. Classic plugin declarations require a Classic instance; putting them into Core's extensions does not create a toolbar.

Try the feature

Find “My product” on the Home ribbon. Insert a note and observe the content change. Open the inspector to read product state; closing it does not change content.

Preparing the example…

1. Declare actions

plugin/notebook.ts defines the plugin, ribbon group and actions. The group's tabId chooses an existing tab; each action's groupId chooses its group.

Actions receive the current editor, product instance and ui. Use Core commands to change content and ui to open panels. The same action can be placed elsewhere without another content command system.

Availability, executability, active state and disabled reasons are separate queries. Classic uses them to refresh controls when selection or read-only state changes.

2. Create and update a sidebar

plugin/panel.ts connects Classic to Vue; plugin/panel.vue renders the inspector. Mounting returns element, update and destroy for DOM, context refresh and cleanup.

Create the Vue root on open, update it when locale or selection changes, and release it on close. Do not recreate subscriptions on every plugin update.

3. Register a file service

The example registers notebook-backup. The download action calls instance.exportDocument('notebook-backup'), then hands its data, filename and MIME to the browser.

Services own conversion. File-menu placement is declared separately, allowing the same service with different menu layouts.

File responsibilities

FilePurpose
plugin/notebook.tsPlugin, groups, actions and file service
plugin/panel.tsConnect sidebar lifecycle to Vue
plugin/panel.vueInspector interface
plugin/editor.vueCreate Classic and install the plugin
product/plugin/notebook.tsts

See Classic plugins and Classic API. For failures and asynchronous loading, continue with files.

QuireKitQuireKit · Core, plugins and Classic docs