@growgroup/visual-editor 0.2.0 → 0.2.1

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": "@growgroup/visual-editor",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "HTMLをブラウザ上で直接編集するビジュアルエディタ。スライド(固定サイズ)とWebページ(可変高さ)の両方に使え、保存先はアダプタで差し替えられます。",
5
5
  "keywords": [
6
6
  "visual-editor",
@@ -1293,7 +1293,7 @@ export const EditorPropertyPanel = memo(function EditorPropertyPanel() {
1293
1293
  <span className="truncate font-medium">部品: {selectedPartLabel}</span>
1294
1294
  </div>
1295
1295
  <p className="text-[10px] leading-snug text-gray-500">
1296
- スロット(data-slot)の中だけ編集できます。定義を変えたあとの他ページへの反映は parts:sync。
1296
+ スロット(data-slot)の中だけ編集できます。「この姿で部品を更新」で定義が変わり、他ページへの反映は利用側(savePart)が行います。
1297
1297
  </p>
1298
1298
  <div className="flex gap-1">
1299
1299
  <Button
@@ -683,11 +683,11 @@ export function useComponentEditMode({
683
683
  });
684
684
  closeContextMenu();
685
685
  toast.success('部品から切り離しました', {
686
- description: 'この要素は普通の HTML になり、parts:sync の対象から外れます',
686
+ description: 'この要素は普通の HTML になり、部品の更新の対象から外れます',
687
687
  });
688
688
  }, [selectedElement?.id, getIframeDoc, notifyIframeChange, setSelectedElement, closeContextMenu]);
689
689
 
690
- // インスタンスの今の姿で定義を更新する(版 +1)。他ページへは利用側の parts:sync で反映する
690
+ // インスタンスの今の姿で定義を更新する(版 +1)。他ページへの反映は利用側(io.savePart の実装)が行う
691
691
  const handleUpdatePart = useCallback(async () => {
692
692
  if (!selectedElement?.id) return;
693
693
  const doc = getIframeDoc();
@@ -698,9 +698,7 @@ export function useComponentEditMode({
698
698
  if (!def) return;
699
699
  notifyIframeChange(true);
700
700
  closeContextMenu();
701
- toast.success(`部品「${def.name ?? def.id}」を v${def.version} に更新しました`, {
702
- description: '他のページのインスタンスへは parts:sync で反映します',
703
- });
701
+ toast.success(`部品「${def.name ?? def.id}」を v${def.version} に更新しました`);
704
702
  } catch (error) {
705
703
  console.error('Failed to update part:', error);
706
704
  toast.error('部品の更新に失敗しました');
package/src/io.ts CHANGED
@@ -77,7 +77,7 @@ export type UploadResult = { url: string; width?: number; height?: number };
77
77
  *
78
78
  * ページに挿すときは**実体化**する: 定義を複製してルートに `data-part` `data-part-v` を付けた
79
79
  * 完全な HTML がページに残る。エディタは `data-slot` の中だけを編集対象にし、
80
- * 定義を変えたあとの一括反映は利用側のスクリプト(parts:sync)が行う。
80
+ * 定義を変えたあとの他ページへの反映は利用側(savePart の実装)が行う。
81
81
  */
82
82
  export type EditorPartDef = {
83
83
  /** 識別子。`data-part` の値になる(ファイル名にも使うので英数字と - _ だけ) */