@threadlabs/looma 0.53.7 → 0.53.9

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.
@@ -5,8 +5,9 @@
5
5
  <prop name="width" type="integer"
6
6
  >Image width in CSS pixels; omitted uses intrinsic size in block/center placement or responsive sizing when wrapping.</prop>
7
7
  <prop name="height" type="integer">Image height in CSS pixels; resizing preserves the intrinsic aspect ratio.</prop>
8
- <prop name="placement" type="keyword" values="block, center, wrap-left, wrap-right" default="block"
9
- >Block keeps text below; center centers the image; wrap-left and wrap-right let following text flow beside it.</prop>
8
+ <prop name="placement" type="keyword" values="block, center, wrap-left, wrap-right, inline" default="block"
9
+ >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
10
+ line.</prop>
10
11
  <prop name="selected" type="boolean" default="false">Outlines the media as the current selection.</prop>
11
12
  <prop name="resizable" type="boolean" default="false"
12
13
  >Shows four corner handles while selected. Drag to resize, or focus a handle and use arrow keys; Shift uses a larger increment.</prop>
@@ -18,18 +19,32 @@
18
19
  Reports resize intent. Preview is transient; the consumer persists a commit. Escape and pointer cancellation restore the original size.
19
20
  </event>
20
21
  </defs>
21
- <figure>
22
- <div class="frame" $ref="frame">
23
- <slot name="media"><img from:src="$src" from:alt="$alt" from:width="$width" from:height="$height"></slot>
24
- <div class="handles" from:hidden="not ($selected and $resizable)">
25
- <button type="button" class="handle" data-corner="top-left" aria-label="Resize image from top left"></button>
26
- <button type="button" class="handle" data-corner="top-right" aria-label="Resize image from top right"></button>
27
- <button type="button" class="handle" data-corner="bottom-left" aria-label="Resize image from bottom left"></button>
28
- <button type="button" class="handle" data-corner="bottom-right" aria-label="Resize image from bottom right"></button>
22
+ <template $match>
23
+ <span $when="$placement = 'inline'">
24
+ <span class="frame" $ref="frame">
25
+ <slot name="media"><img from:src="$src" from:alt="$alt" from:width="$width" from:height="$height"></slot>
26
+ <span class="handles" from:hidden="not ($selected and $resizable)">
27
+ <button type="button" class="handle" data-corner="top-left" aria-label="Resize image from top left"></button>
28
+ <button type="button" class="handle" data-corner="top-right" aria-label="Resize image from top right"></button>
29
+ <button type="button" class="handle" data-corner="bottom-left" aria-label="Resize image from bottom left"></button>
30
+ <button type="button" class="handle" data-corner="bottom-right" aria-label="Resize image from bottom right"></button>
31
+ </span>
32
+ <slot name="controls"></slot>
33
+ </span>
34
+ </span>
35
+ <figure $else>
36
+ <div class="frame" $ref="frame">
37
+ <slot name="media"><img from:src="$src" from:alt="$alt" from:width="$width" from:height="$height"></slot>
38
+ <div class="handles" from:hidden="not ($selected and $resizable)">
39
+ <button type="button" class="handle" data-corner="top-left" aria-label="Resize image from top left"></button>
40
+ <button type="button" class="handle" data-corner="top-right" aria-label="Resize image from top right"></button>
41
+ <button type="button" class="handle" data-corner="bottom-left" aria-label="Resize image from bottom left"></button>
42
+ <button type="button" class="handle" data-corner="bottom-right" aria-label="Resize image from bottom right"></button>
43
+ </div>
44
+ <slot name="controls"></slot>
29
45
  </div>
30
- <slot name="controls"></slot>
31
- </div>
32
- </figure>
46
+ </figure>
47
+ </template>
33
48
  <style>
34
49
  :host {
35
50
  display: flex !important;
@@ -43,6 +58,11 @@
43
58
  :host([placement="center"]) {
44
59
  justify-content: center !important;
45
60
  }
61
+ :host([placement="inline"]) {
62
+ display: inline-flex !important;
63
+ padding: 0 !important;
64
+ vertical-align: baseline;
65
+ }
46
66
  :host([placement="wrap-left"]) {
47
67
  float: left;
48
68
  padding-inline-end: var(--ui-space-4) !important;