@jvs-milkdown/crepe 1.2.30 → 1.2.31

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.
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAIhE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,GAAG,EAKT,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,GAAG,CAAA;AAalD,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,oXAuPhC,CAAA"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/feature/fixed-toolbar/component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAGhE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,GAAG,EAMT,MAAM,KAAK,CAAA;AAEZ,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,GAAG,CAAA;AAalD,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAClB,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,oXAuPhC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jvs-milkdown/crepe",
3
- "version": "1.2.30",
3
+ "version": "1.2.31",
4
4
  "keywords": [
5
5
  "crepe",
6
6
  "editor",
@@ -107,9 +107,9 @@
107
107
  "@codemirror/theme-one-dark": "^6.1.2",
108
108
  "@codemirror/view": "^6.26.0",
109
109
  "@floating-ui/dom": "^1.7.6",
110
- "@jvs-milkdown/kit": "^1.2.30",
111
- "@jvs-milkdown/prose": "^1.2.30",
112
- "@jvs-milkdown/utils": "^1.2.30",
110
+ "@jvs-milkdown/kit": "^1.2.31",
111
+ "@jvs-milkdown/prose": "^1.2.31",
112
+ "@jvs-milkdown/utils": "^1.2.31",
113
113
  "@types/lodash-es": "^4.17.12",
114
114
  "clsx": "^2.0.0",
115
115
  "codemirror": "^6.0.1",
@@ -2,12 +2,12 @@ import type { Ctx } from '@jvs-milkdown/kit/ctx'
2
2
  import type { EditorState } from '@jvs-milkdown/kit/prose/state'
3
3
 
4
4
  import { commandsCtx } from '@jvs-milkdown/kit/core'
5
- // @ts-ignore
6
5
  import {
7
6
  defineComponent,
8
7
  type ShallowRef,
9
8
  type Ref,
10
9
  ref,
10
+ computed,
11
11
  onMounted,
12
12
  onUnmounted,
13
13
  h,
@@ -78,8 +78,8 @@ export const FixedToolbarComponent = defineComponent<FixedToolbarProps>({
78
78
  : props.canRedo?.value) || false
79
79
 
80
80
  const viewState = props.ctx.get(viewMenuStateCtx.key)
81
- const maxWidth = editorWidthMap[viewState.editorWidth as EditorWidth]
82
- const isFull = maxWidth === 'none'
81
+ const maxWidth = computed(() => editorWidthMap[viewState.editorWidth as EditorWidth])
82
+ const isFull = computed(() => maxWidth.value === 'none')
83
83
 
84
84
  if (!viewState.fixedToolbarVisible) {
85
85
  return (
@@ -138,8 +138,8 @@ export const FixedToolbarComponent = defineComponent<FixedToolbarProps>({
138
138
  alignItems: 'center',
139
139
  justifyContent: 'center',
140
140
  width: '100%',
141
- maxWidth: isFull ? '100%' : maxWidth,
142
- margin: isFull ? '0' : '0 auto',
141
+ maxWidth: isFull.value ? '100%' : maxWidth.value,
142
+ margin: isFull.value ? '0' : '0 auto',
143
143
  gap: '0px',
144
144
  minWidth: '0',
145
145
  overflow: 'hidden',
@@ -198,7 +198,7 @@ class FixedToolbarView implements PluginView {
198
198
 
199
199
  const app = createApp(FixedToolbarComponent, {
200
200
  ctx,
201
- hide: () => {}, // No-op for fixed toolbar
201
+ hide: () => { }, // No-op for fixed toolbar
202
202
  config,
203
203
  state: this.#state,
204
204
  show: this.#show,
@@ -415,7 +415,7 @@ class FixedToolbarView implements PluginView {
415
415
 
416
416
  const maxWidth = (editorWidthMap as any)[viewState.editorWidth]
417
417
  const isFull = maxWidth === 'none'
418
- const px = isFull ? '80px' : '10px'
418
+ const px = isFull ? '80px' : '0px'
419
419
  this.#view.dom.style.maxWidth = maxWidth
420
420
  this.#view.dom.style.width = isFull ? '100%' : maxWidth
421
421
  this.#view.dom.style.margin = isFull ? '0' : '0 auto'