From 82dd61549bccd91837cb875e5c5d1e55f6b84b05 Mon Sep 17 00:00:00 2001 From: vegard Date: Wed, 18 Mar 2026 08:47:20 +0000 Subject: [PATCH] =?UTF-8?q?Gj=C3=B8r=20EditorTrait=20til=20fullverdig=20Bl?= =?UTF-8?q?ockShell-panel=20med=20inline=20editor=20og=20kilder=20(oppgave?= =?UTF-8?q?=2020.8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fjerner TraitPanel-wrapper og erstatter med selvstendig panel-layout som matcher KanbanTrait/CalendarTrait-mønsteret: - Selvstendig layout som fyller BlockShell content area - Listevisning med klikk-for-å-redigere (inline tittel + innhold) - Source_material-edges vises som "Kilder"-sidebar i editor-visningen - Visuell venstrekant-markering på artikler med kilder - Opprett ny artikkel direkte fra panelet - Container queries for responsiv tilpasning (small/medium/mobile) - Beholder all eksisterende funksjonalitet: AI preset drops, publisering, drag-and-drop ut av panelet Co-Authored-By: Claude Opus 4.6 (1M context) --- .../lib/components/traits/EditorTrait.svelte | 1277 +++++++++++++++-- tasks.md | 3 +- 2 files changed, 1150 insertions(+), 130 deletions(-) diff --git a/frontend/src/lib/components/traits/EditorTrait.svelte b/frontend/src/lib/components/traits/EditorTrait.svelte index ec5233e..b07e6f8 100644 --- a/frontend/src/lib/components/traits/EditorTrait.svelte +++ b/frontend/src/lib/components/traits/EditorTrait.svelte @@ -1,8 +1,7 @@ - - {#snippet children()} -

- Preset: {preset} - {#if config.allow_collaborators} - · Samarbeid aktivert - {/if} - {#if isPublishingCollection} - · Publisering aktiv - {/if} -

+ - {#if unpublishError} -
- {unpublishError} - -
- {/if} - - {#if contentItems.length === 0} -

Ingen innholdsnoder ennå.

- {:else} -
    - {#each contentItems as item (item.node.id)} - {@const isDropTarget = dropTargetNodeId === item.node.id} - {@const isIncompat = isDropTarget && dropIncompat} - {@const isProcessing = aiProcessing === item.node.id} - {@const itemResult = aiResult?.nodeId === item.node.id ? aiResult : null} -
  • handleItemDragStart(e, item)} - ondragover={(e) => handleItemDragOver(e, item)} - ondragleave={(e) => handleItemDragLeave(e, item)} - ondrop={(e) => handleItemDrop(e, item)} +
    + {#if selectedItem} + + + +
    +
    + +
    + {#if selectedSourceLinks.length > 0} + + {/if} + + {#if saveMessage} + + {saveMessage} + + {/if} +
    +
    + +
    +
    + + +
    + + + {#if showSources && selectedSourceLinks.length > 0} +
    +

    Kilder

    +
      + {#each selectedSourceLinks as sl (sl.edge.id)} +
    • + {kindIcon(sl.sourceNode.nodeKind)} +
      + {sl.sourceNode.title || 'Uten tittel'} + {sl.context} +
      +
    • + {/each} +
    +
    + {/if} +
    +
    + {:else} + + + +
    + {#if unpublishError} +
    + {unpublishError} + +
    + {/if} + +
    + + {preset} + {#if config.allow_collaborators} + · Samarbeid + {/if} + {#if isPublishingCollection} + · Publisering + {/if} + + {contentItems.length} +
    + + {#if contentItems.length === 0} +
    + 📝 +

    Ingen artikler ennå.

    +

    Opprett en ny, eller dra innhold fra andre paneler.

    +
    + {:else} +
    + {#each contentItems as item (item.node.id)} + {@const isDropTarget = dropTargetNodeId === item.node.id} + {@const isIncompat = isDropTarget && dropIncompat} + {@const isProcessing = aiProcessing === item.node.id} + {@const itemResult = aiResult?.nodeId === item.node.id ? aiResult : null} + {@const itemSourceCount = (() => { + let c = 0; + for (const e of edgeStore.bySource(item.node.id)) { + if (e.edgeType === 'source_material') c++; + } + return c; + })()} + +
    handleItemDragStart(e, item)} + ondragover={(e) => handleItemDragOver(e, item)} + ondragleave={(e) => handleItemDragLeave(e, item)} + ondrop={(e) => handleItemDrop(e, item)} + onclick={() => selectItem(item)} + onkeydown={(e) => { if (e.key === 'Enter') selectItem(item); }} + role="button" + tabindex="0" + > + {#if isIncompat} + + {:else if isDropTarget} + + {:else} +
    + {#if itemSourceCount > 0} + + {/if} +
    + + {item.node.title || 'Uten tittel'} + {#if isProcessing} + Prosesserer… + {/if} + + {#if item.node.content} + {item.node.content.slice(0, 120)} + {/if} + {#if itemResult} + + {itemResult.message} + + {/if} +
    +
    + {#if itemSourceCount > 0} + 📎 {itemSourceCount} + {/if} + {#if formatTime(item.node)} + {formatTime(item.node)} + {/if} +
    +
    + {#if isPublishingCollection && accessToken} -
    +
    {#if pubSlug} - Se - + class="editor-item-action" + title="Se publisert" + onclick={(e) => e.stopPropagation()} + >Se {/if}
    {/if} -
    - {/if} -
  • - {/each} -
- {/if} + {/if} + + {/each} + + {/if} - - {#if isPublishingCollection && accessToken} -
- -
+ + {#if accessToken} +
+ {#if showCreateForm} +
+ +
+ + +
+
+ {:else} + + {/if} + + {#if isPublishingCollection} + + {/if} +
+ {/if} - {#if showPublishPicker} -
-

Velg artikkel å publisere

+ {#if showPublishPicker && isPublishingCollection} +
+

Velg artikkel å publisere

{#if publishableNodes.length === 0} -

Ingen upubliserte artikler funnet. Opprett innhold via mottaket først.

+

Ingen upubliserte artikler funnet.

{:else} -
    +
      {#each publishableNodes as pNode (pNode.id)}
    • @@ -376,9 +656,9 @@ {/if}
{/if} - {/if} - {/snippet} - +
+ {/if} + {#if publishTarget && accessToken && pubConfig} @@ -428,3 +708,744 @@ {/if} + + diff --git a/tasks.md b/tasks.md index 5106647..454f98a 100644 --- a/tasks.md +++ b/tasks.md @@ -230,8 +230,7 @@ Ref: `docs/features/universell_overfoering.md`, `docs/retninger/arbeidsflaten.md - [x] 20.5 Panelrework — Chat: gjør ChatTrait til fullverdig BlockShell-panel med BlockReceiver, fullskjerm-toggle, og responsivt design innenfor begrenset container. - [x] 20.6 Panelrework — Kanban: gjør KanbanTrait til BlockShell-panel med drag-and-drop aksept fra andre paneler, fullskjerm, responsivt. - [x] 20.7 Panelrework — Kalender: gjør CalendarTrait til BlockShell-panel med drop-aksept for scheduling, fullskjerm, responsivt. -- [~] 20.8 Panelrework — Editor/Artikkelverktøy: gjør artikkelverktøy til BlockShell-panel med source_material mottak fra andre paneler. Ref: `docs/features/artikkelverktoy.md`. - > Påbegynt: 2026-03-18T08:41 +- [x] 20.8 Panelrework — Editor/Artikkelverktøy: gjør artikkelverktøy til BlockShell-panel med source_material mottak fra andre paneler. Ref: `docs/features/artikkelverktoy.md`. - [ ] 20.9 Panelrework — Studio: gjør StudioTrait til BlockShell-panel med drop-aksept for lydfiler, fullskjerm, responsivt. ## Fase 21: CLI-verktøy — Unix-filosofi