@difizen/libro-output 0.3.30 → 0.3.32

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.
@@ -8,7 +8,7 @@ export declare class DisplayDataOutputModel extends LibroOutputView implements B
8
8
  renderFactory?: IRendererFactory;
9
9
  constructor(options: IOutputOptions);
10
10
  getRenderFactory(): IRendererFactory | undefined;
11
- view: import("react").ForwardRefExoticComponent<Omit<Record<string, never>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
11
+ view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
12
12
  toJSON(): {
13
13
  output_type: string;
14
14
  data: import("@difizen/libro-common").PartialJSONValue | import("@difizen/libro-common").IMimeBundle | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"display-data-output-model.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-model.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAavF,OAAO,eAAe,CAAC;AAyBvB,qBAEa,sBAAuB,SAAQ,eAAgB,YAAW,cAAc;IACvD,kBAAkB,EAAE,mBAAmB,CAAC;IACpE,aAAa,CAAC,EAAE,gBAAgB,CAAC;gBACD,OAAO,EAAE,cAAc;IAQvD,gBAAgB;IAUP,IAAI,gIAAgC;IACpC,MAAM;;;;;;;;;;;;;IAgBN,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAMxC"}
1
+ {"version":3,"file":"display-data-output-model.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-model.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAWvF,OAAO,eAAe,CAAC;AAmBvB,qBAEa,sBAAuB,SAAQ,eAAgB,YAAW,cAAc;IACvD,kBAAkB,EAAE,mBAAmB,CAAC;IACpE,aAAa,CAAC,EAAE,gBAAgB,CAAC;gBACD,OAAO,EAAE,cAAc;IAQvD,gBAAgB;IAUP,IAAI,2FAAgC;IACpC,MAAM;;;;;;;;;;;;;IAgBN,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI;CAMxC"}
@@ -20,26 +20,27 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
20
20
  import { getBundleOptions } from '@difizen/libro-common';
21
21
  import { LibroOutputView } from '@difizen/libro-core';
22
22
  import { RenderMimeRegistry } from '@difizen/libro-rendermime';
23
- import { getOrigin, useInject, view, ViewInstance, ViewOption, inject, transient } from '@difizen/mana-app';
24
- import { createElement, forwardRef } from 'react';
23
+ import { getOrigin, useInject, view, ViewInstance, ViewOption } from '@difizen/mana-app';
24
+ import { inject, transient } from '@difizen/mana-app';
25
+ import { forwardRef } from 'react';
25
26
  import "../index.less";
27
+ import { jsx as _jsx } from "react/jsx-runtime";
26
28
  var DisplayDataOutputModelRender = /*#__PURE__*/forwardRef(function DisplayDataOutputModelRender(_props, ref) {
27
29
  var output = useInject(ViewInstance);
28
30
  var model = getOrigin(output);
29
31
  var factory = model.getRenderFactory();
30
32
  var children = null;
31
- if (factory && factory.render) {
32
- var renderFunction = factory.render;
33
- if (typeof renderFunction === 'function') {
34
- children = renderFunction({
35
- model: model
36
- });
37
- }
33
+ if (factory) {
34
+ var OutputRender = factory.render;
35
+ children = /*#__PURE__*/_jsx(OutputRender, {
36
+ model: model
37
+ });
38
38
  }
39
- return /*#__PURE__*/createElement('div', {
39
+ return /*#__PURE__*/_jsx("div", {
40
40
  ref: ref,
41
- className: 'libro-display-data-container'
42
- }, children);
41
+ className: 'libro-display-data-container',
42
+ children: children
43
+ });
43
44
  });
44
45
  export var DisplayDataOutputModel = (_dec = transient(), _dec2 = view('libro-display-data-output-model'), _dec3 = inject(RenderMimeRegistry), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_LibroOutputView) {
45
46
  _inherits(DisplayDataOutputModel, _LibroOutputView);
@@ -1 +1 @@
1
- {"version":3,"file":"display-data-output-setting.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,OAAO,CAS7D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,CAAC,MAAM,CAUlE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,OAAO,CASpE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAmBzE,CAAC"}
1
+ {"version":3,"file":"display-data-output-setting.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,OAAO,CAS7D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,CAAC,MAAM,CAUlE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,OAAO,CASpE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAYzE,CAAC"}
@@ -43,21 +43,5 @@ export var ImageProcessingSupportedMimeTypes = {
43
43
  items: {
44
44
  type: 'string'
45
45
  }
46
- },
47
- options: [{
48
- label: 'PNG',
49
- value: 'image/png'
50
- }, {
51
- label: 'JPEG',
52
- value: 'image/jpeg'
53
- }, {
54
- label: 'GIF',
55
- value: 'image/gif'
56
- }, {
57
- label: 'WebP',
58
- value: 'image/webp'
59
- }, {
60
- label: 'SVG',
61
- value: 'image/svg+xml'
62
- }]
46
+ }
63
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-output",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -32,9 +32,9 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@difizen/libro-common": "^0.3.30",
36
- "@difizen/libro-core": "^0.3.30",
37
- "@difizen/libro-rendermime": "^0.3.30",
35
+ "@difizen/libro-common": "^0.3.32",
36
+ "@difizen/libro-core": "^0.3.32",
37
+ "@difizen/libro-rendermime": "^0.3.32",
38
38
  "@difizen/mana-app": "latest",
39
39
  "@difizen/mana-l10n": "^0.1.32",
40
40
  "markdown-it": "^13.0.1"
@@ -10,34 +10,26 @@ import {
10
10
  view,
11
11
  ViewInstance,
12
12
  ViewOption,
13
- inject,
14
- transient,
15
13
  } from '@difizen/mana-app';
16
- import type { ReactNode } from 'react';
17
- import { createElement, forwardRef } from 'react';
14
+ import { inject, transient } from '@difizen/mana-app';
15
+ import { forwardRef } from 'react';
18
16
 
19
17
  import '../index.less';
20
18
 
21
- const DisplayDataOutputModelRender = forwardRef<HTMLDivElement, Record<string, never>>(
22
- function DisplayDataOutputModelRender(_props, ref): React.ReactElement {
19
+ const DisplayDataOutputModelRender = forwardRef<HTMLDivElement>(
20
+ function DisplayDataOutputModelRender(_props, ref) {
23
21
  const output = useInject<DisplayDataOutputModel>(ViewInstance);
24
22
  const model = getOrigin(output);
25
-
26
23
  const factory = model.getRenderFactory();
27
- let children: ReactNode = null;
28
- if (factory && factory.render) {
29
- const renderFunction = factory.render;
30
- if (typeof renderFunction === 'function') {
31
- children = renderFunction({ model });
32
- }
24
+ let children = null;
25
+ if (factory) {
26
+ const OutputRender = factory.render;
27
+ children = <OutputRender model={model} />;
33
28
  }
34
- return createElement(
35
- 'div',
36
- {
37
- ref,
38
- className: 'libro-display-data-container',
39
- },
40
- children,
29
+ return (
30
+ <div ref={ref} className={'libro-display-data-container'}>
31
+ {children}
32
+ </div>
41
33
  );
42
34
  },
43
35
  );
@@ -48,11 +48,4 @@ export const ImageProcessingSupportedMimeTypes: ConfigurationNode<string[]> = {
48
48
  type: 'string',
49
49
  },
50
50
  },
51
- options: [
52
- { label: 'PNG', value: 'image/png' },
53
- { label: 'JPEG', value: 'image/jpeg' },
54
- { label: 'GIF', value: 'image/gif' },
55
- { label: 'WebP', value: 'image/webp' },
56
- { label: 'SVG', value: 'image/svg+xml' },
57
- ],
58
51
  };