@arkitektbedriftene/fe-lib 2.0.1 → 2.0.3

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.
@@ -41,6 +41,10 @@ export declare class ImageNode extends DecoratorNode<JSX.Element> {
41
41
  height: number;
42
42
  }, key?: NodeKey);
43
43
  exportJSON(): SerializedImageNode;
44
+ getMeta(): {
45
+ width: number;
46
+ height: number;
47
+ };
44
48
  setSrc(src: string): void;
45
49
  setWidthAndHeight(width: "inherit" | number, height: "inherit" | number): void;
46
50
  createDOM(config: EditorConfig): HTMLElement;
@@ -227,7 +227,7 @@ class z extends ae {
227
227
  }
228
228
  exportDOM() {
229
229
  const e = document.createElement("img");
230
- return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), this.__width !== "inherit" && e.setAttribute("width", this.__width.toString()), this.__height !== "inherit" && e.setAttribute("height", this.__height.toString()), { element: e };
230
+ return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.setAttribute("class", "ain-rich-text-image"), this.__width !== "inherit" && e.setAttribute("width", this.__width.toString()), this.__height !== "inherit" && e.setAttribute("height", this.__height.toString()), { element: e };
231
231
  }
232
232
  static importDOM() {
233
233
  return {
@@ -248,6 +248,9 @@ class z extends ae {
248
248
  meta: this.__meta
249
249
  };
250
250
  }
251
+ getMeta() {
252
+ return this.__meta ?? { width: 0, height: 0 };
253
+ }
251
254
  setSrc(e) {
252
255
  const n = this.getWritable();
253
256
  n.__src = e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {