@lincyaw/workbench 0.2.0-rc.97 → 0.2.0-rc.99

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/workbench",
3
- "version": "0.2.0-rc.97",
3
+ "version": "0.2.0-rc.99",
4
4
  "description": "Presmium's workbench panels in React (the documents, a document edited on its rendered page with comments and version history) with the workspace service's client and the preview protocol's workbench side; @lincyaw/dsh places them in presmium studio (experimental)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -55,8 +55,8 @@
55
55
  "@tiptap/pm": "3.32.0",
56
56
  "katex": "0.18.10",
57
57
  "react-resizable-panels": "4.14.5",
58
- "@lincyaw/design": "1.0.0-rc.97",
59
- "@lincyaw/kernel": "1.0.0-rc.97"
58
+ "@lincyaw/design": "1.0.0-rc.99",
59
+ "@lincyaw/kernel": "1.0.0-rc.99"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^18.3.1",
@@ -67,6 +67,6 @@
67
67
  "@types/react-dom": "18.3.7",
68
68
  "react": "^18.3.1",
69
69
  "react-dom": "^18.3.1",
70
- "@lincyaw/compiler": "1.0.0-rc.97"
70
+ "@lincyaw/compiler": "1.0.0-rc.99"
71
71
  }
72
72
  }
@@ -27,6 +27,8 @@ export function DocumentBlockPreview({ blockId, fallback }: { blockId: string, f
27
27
  const position = useWorkbenchState(state => state.position)
28
28
  const navigation = useWorkbenchState(state => state.documentPositionToken)
29
29
  const navigationIntent = useWorkbenchState(state => state.documentPositionIntent)
30
+ const block = source?.content?.blocks[blockId]
31
+ const definition = block?.type === 'component' ? source?.content?.definitions[block.definitionId] : undefined
30
32
  const sectionId = source?.content && documentBlockSection(source.content, blockId)
31
33
  const section = sectionId ? source?.content?.sections[sectionId] : undefined
32
34
  const stepId = section?.stepOrder[position && position.section === sectionId ? position.step : 0] ?? section?.stepOrder[0]
@@ -218,7 +220,7 @@ export function DocumentBlockPreview({ blockId, fallback }: { blockId: string, f
218
220
  <header className="pm-ui-block-preview__header"><span className="pm-ui-block-preview__label" role={state.status === 'failed' ? 'status' : undefined}><PmIcon name="slides" />{state.status === 'failed' ? t.previewFailure : old && state.snapshot ? t.previewPrevious : state.status === 'preparing' ? p.preparing : state.status === 'loading' ? t.previewLoading : t.previewSnapshot}</span>
219
221
  <span className="pm-ui-block-preview__actions">
220
222
  {sectionId && stepId && <PlaceCommentButton blockId={blockId} sectionId={sectionId} stepId={stepId} stepIndex={section ? section.stepOrder.indexOf(stepId) + 1 : 1} onPause={pause} />}
221
- {source?.content?.blocks[blockId]?.type === 'component' && <PmIconButton small icon="sliders" label={COMPONENT_PROPERTY_MESSAGES[locale].properties}
223
+ {source && block?.type === 'component' && definition?.kind !== 'scene' && <PmIconButton small icon="sliders" label={COMPONENT_PROPERTY_MESSAGES[locale].properties}
222
224
  data-component-properties={blockId} disabled={!source.identity || workbench.client.capabilities?.readOnly} onClick={() => { if (source.identity && !workbench.client.capabilities?.readOnly) setProperties({ identity: source.identity, stepId }) }} />}
223
225
  {workbench.client.capabilities?.narration !== false && <PmIconButton small icon="captions" label={t.stepCaptions} aria-expanded={narrationOpen} aria-controls={narrationOpen ? narrationPanel : undefined} aria-pressed={narrationOpen} disabled={!stepId} onClick={() => {
224
226
  pause()
@@ -210,10 +210,11 @@ export function DocumentView({ active = true, framed = false, onBack, actions, h
210
210
  <div ref={container.ref} className="pmw-document" data-roomy={roomy || undefined} data-narrow={narrow || undefined} data-workspace={producing ? 'production' : presenting ? 'presentation' : reading ? 'reading' : 'content'} data-presenting={presenting || undefined} data-aside={aside ?? undefined} data-navigation={navigation || undefined}>
211
211
  {reading && <PmToolbar variant="workspace" className="pmw-toolbar" label={t.commands}>
212
212
  <span className="pmw-toolbar__title">{t.readDocument}</span>
213
- {actions}
213
+ <span className="pmw-spacer" />
214
214
  <PmToolbarButton asChild><PmIconButton small icon="edit" label={t.editDocument} disabled={changingView} onClick={() => void exitPresent()} /></PmToolbarButton>
215
215
  <PmToolbarButton asChild><PmIconButton small icon="refresh" label={t.reloadPreview} loading={changingView} onClick={() => void compilePresentation(() => workbench.reloadPreview(), true)} /></PmToolbarButton>
216
216
  <PmToolbarButton asChild><PmIconButton small icon="slides" label={t.present} disabled={changingView} onClick={() => void compilePresentation(() => { workbench.setWebView('present'); setWorkspace('presentation') })} /></PmToolbarButton>
217
+ {actions}
217
218
  </PmToolbar>}
218
219
  {!producing && !presenting && !reading && <DocumentToolbar narrow={narrow} presentButton={presentButton} framed={framed} onBack={onBack} actions={actions} aside={aside} navigation={navigation} changingView={changingView} onProduction={() => void openProduction()} onRead={() => void compilePresentation(() => {
219
220
  workbench.setMode('viewing')