@threadlabs/looma 0.53.7 → 0.53.8

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/docs/catalog.json CHANGED
@@ -431,7 +431,7 @@
431
431
  "tag": "ui-image",
432
432
  "package": "@threadlabs/looma",
433
433
  "root": "figure",
434
- "angularHost": "figure",
434
+ "angularHost": "ng-template",
435
435
  "resource": "@threadlabs/looma/components/ui-image/ui-image.html"
436
436
  },
437
437
  {
@@ -780,7 +780,7 @@
780
780
  ],
781
781
  "schemaVersion": 1,
782
782
  "package": "@threadlabs/looma",
783
- "version": "0.53.7",
783
+ "version": "0.53.8",
784
784
  "groups": [
785
785
  {
786
786
  "id": "layout",
@@ -20774,11 +20774,11 @@
20774
20774
  ]
20775
20775
  },
20776
20776
  {
20777
- "angularHost": "figure",
20777
+ "angularHost": "ng-template",
20778
20778
  "tag": "ui-image",
20779
20779
  "package": "@threadlabs/looma",
20780
20780
  "root": "figure",
20781
- "description": "A semantic image surface with optional selection, corner resizing, and text wrapping.",
20781
+ "description": "An inline or block image surface with optional selection, corner resizing, and text wrapping.",
20782
20782
  "designTokens": {
20783
20783
  "sources": [
20784
20784
  "packages/looma/src/components/ui-image/ui-image.html"
@@ -20836,7 +20836,7 @@
20836
20836
  {
20837
20837
  "name": "placement",
20838
20838
  "property": "placement",
20839
- "description": "Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it.",
20839
+ "description": "Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it. Inline keeps the image within a text line.",
20840
20840
  "type": "keyword",
20841
20841
  "valueType": {
20842
20842
  "kind": "terminal",
@@ -20847,7 +20847,8 @@
20847
20847
  "block",
20848
20848
  "center",
20849
20849
  "wrap-left",
20850
- "wrap-right"
20850
+ "wrap-right",
20851
+ "inline"
20851
20852
  ]
20852
20853
  },
20853
20854
  {
@@ -20908,14 +20909,15 @@
20908
20909
  },
20909
20910
  {
20910
20911
  "name": "placement",
20911
- "description": "Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it.",
20912
- "type": "\"block\" | \"center\" | \"wrap-left\" | \"wrap-right\"",
20912
+ "description": "Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it. Inline keeps the image within a text line.",
20913
+ "type": "\"block\" | \"center\" | \"wrap-left\" | \"wrap-right\" | \"inline\"",
20913
20914
  "default": "block",
20914
20915
  "options": [
20915
20916
  "block",
20916
20917
  "center",
20917
20918
  "wrap-left",
20918
- "wrap-right"
20919
+ "wrap-right",
20920
+ "inline"
20919
20921
  ]
20920
20922
  },
20921
20923
  {
@@ -21023,6 +21025,16 @@
21023
21025
  "resizable": false,
21024
21026
  "bindings": "",
21025
21027
  "frameworks": {}
21028
+ },
21029
+ {
21030
+ "id": "@threadlabs/looma/ui-image/03-inline",
21031
+ "name": "03-inline",
21032
+ "title": "Inline image",
21033
+ "description": "A small image stays beside the text and shares its line.",
21034
+ "markup": "<p>Before <ui-image src=\"/_looma/pastoral.svg\" alt=\"Green hills\" width=\"48\" height=\"30\" placement=\"inline\"></ui-image> after.</p>",
21035
+ "resizable": false,
21036
+ "bindings": "",
21037
+ "frameworks": {}
21026
21038
  }
21027
21039
  ]
21028
21040
  },
@@ -10419,13 +10419,13 @@ function getLoomaTableExtensions() {
10419
10419
  * the code and explicit language stay in the document schema.
10420
10420
  */
10421
10421
  function getDefaultEditorExtensions(options = {}) {
10422
- const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, linkBaseUrl, imageInline = false, imageNodeView, dividerNodeView, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView, tableOfContentsNodeView, expandNodeView, calloutNodeView } = options;
10422
+ const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, linkBaseUrl, imageInline = false, imageNodeView, inlineImageNodeView, dividerNodeView, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView, tableOfContentsNodeView, expandNodeView, calloutNodeView } = options;
10423
10423
  const image = LoomaImage.configure({ inline: imageInline });
10424
10424
  const codeBlock = LoomaCodeBlock.configure({ lowlight: codeLowlight ?? createLowlight(codeLanguages) });
10425
10425
  return [
10426
10426
  Document,
10427
10427
  Paragraph,
10428
- LoomaInlineImage,
10428
+ inlineImageNodeView ? LoomaInlineImage.extend({ addNodeView: () => inlineImageNodeView }) : LoomaInlineImage,
10429
10429
  LoomaLineBlock,
10430
10430
  Text$1,
10431
10431
  LoomaReference,
@@ -3749,6 +3749,11 @@
3749
3749
  :scope:where(:is([component~="ui-image"]:not(template), [data-component~="ui-image"]:not([component])))[data-ui-image-state~="placement=center"] {
3750
3750
  justify-content: center !important;
3751
3751
  }
3752
+ :scope:where(:is([component~="ui-image"]:not(template), [data-component~="ui-image"]:not([component])))[data-ui-image-state~="placement=inline"] {
3753
+ display: inline-flex !important;
3754
+ padding: 0 !important;
3755
+ vertical-align: baseline;
3756
+ }
3752
3757
  :scope:where(:is([component~="ui-image"]:not(template), [data-component~="ui-image"]:not([component])))[data-ui-image-state~="placement=wrap-left"] {
3753
3758
  float: left;
3754
3759
  padding-inline-end: var(--ui-space-4) !important;
@@ -25,6 +25,8 @@ export interface DefaultEditorExtensionsOptions {
25
25
  imageInline?: boolean;
26
26
  /** Optional image selection and sizing UI; durable formatting stays in the shared schema. */
27
27
  imageNodeView?: NodeViewRenderer;
28
+ /** Optional inline media UI; the extension entry point remains independent of UI registration. */
29
+ inlineImageNodeView?: NodeViewRenderer;
28
30
  /** Optional selected-state UI for document dividers. */
29
31
  dividerNodeView?: NodeViewRenderer;
30
32
  /** Custom mention extension, the Looma default, or false to omit mentions. */