ywana-core8 0.0.281 → 0.0.284
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/dist/index.cjs +31 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +31 -27
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +31 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +7 -8
- package/src/domain/TablePage.js +7 -7
- package/src/site/view.css +2 -0
package/package.json
CHANGED
@@ -9,18 +9,15 @@ import { CreateContentDialog } from './CreateContentDialog_old'
|
|
9
9
|
import { SiteContext } from '../site/siteContext'
|
10
10
|
import "./CollectionPage.css"
|
11
11
|
|
12
|
-
|
13
|
-
const http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
14
|
-
|
15
12
|
/**
|
16
13
|
* Collection Page
|
17
14
|
*/
|
18
15
|
export const CollectionPage = (props) => {
|
19
16
|
|
20
17
|
const site = useContext(SiteContext)
|
21
|
-
const { id = "collection", icon, title, name = "Collection 1", schema, url, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect } = props
|
18
|
+
const { id = "collection", icon, title, name = "Collection 1", schema, url, host, groupBy, editor, field, autosave = false, delay = 1000, actions, levels, onSelect } = props
|
22
19
|
const [pageContext, setPageContext] = useContext(PageContext)
|
23
|
-
const context = CollectionContext(url, field)
|
20
|
+
const context = CollectionContext(url, field, host)
|
24
21
|
|
25
22
|
useEffect(async () => {
|
26
23
|
await context.load()
|
@@ -239,9 +236,9 @@ const CollectionEditor = (props) => {
|
|
239
236
|
/**
|
240
237
|
* Collection Context
|
241
238
|
*/
|
242
|
-
export const CollectionContext = (url, field) => {
|
239
|
+
export const CollectionContext = (url, field, host) => {
|
243
240
|
|
244
|
-
const API = CollectionAPI(url)
|
241
|
+
const API = CollectionAPI(url, host)
|
245
242
|
|
246
243
|
return {
|
247
244
|
|
@@ -322,7 +319,9 @@ export const CollectionContext = (url, field) => {
|
|
322
319
|
/**
|
323
320
|
* Collection API
|
324
321
|
*/
|
325
|
-
const CollectionAPI = (url) => {
|
322
|
+
const CollectionAPI = (url, host) => {
|
323
|
+
|
324
|
+
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
326
325
|
|
327
326
|
return {
|
328
327
|
all(filters) {
|
package/src/domain/TablePage.js
CHANGED
@@ -9,8 +9,6 @@ import { ContentViewer } from './ContentViewer'
|
|
9
9
|
import { CreateContentDialog } from './CreateContentDialog'
|
10
10
|
import "./TablePage.css"
|
11
11
|
|
12
|
-
const http = HTTPClient(window.API || process.env.REACT_APP_API, Session);
|
13
|
-
|
14
12
|
/**
|
15
13
|
* Table Page
|
16
14
|
*/
|
@@ -19,7 +17,7 @@ export const TablePage = (props) => {
|
|
19
17
|
const site = useContext(SiteContext)
|
20
18
|
const { id = "table",
|
21
19
|
icon, title, name,
|
22
|
-
schema, url, field,
|
20
|
+
schema, url, field, host,
|
23
21
|
autosave = true, delay = 1000,
|
24
22
|
editable,
|
25
23
|
actions = [], dev = false, tableActions, selectionActions = [],
|
@@ -47,7 +45,7 @@ export const TablePage = (props) => {
|
|
47
45
|
}, [form])
|
48
46
|
|
49
47
|
useEffect(async () => {
|
50
|
-
const context = TableContext(url, field)
|
48
|
+
const context = TableContext(url, field, host)
|
51
49
|
await context.load()
|
52
50
|
setPageContext(context)
|
53
51
|
}, [])
|
@@ -407,9 +405,9 @@ export const TableEditor = (props) => {
|
|
407
405
|
/**
|
408
406
|
* Table Context
|
409
407
|
*/
|
410
|
-
const TableContext = (url, field) => {
|
408
|
+
const TableContext = (url, field, host) => {
|
411
409
|
|
412
|
-
const API = TableAPI(url)
|
410
|
+
const API = TableAPI(url, host)
|
413
411
|
|
414
412
|
return {
|
415
413
|
|
@@ -491,7 +489,9 @@ const TableContext = (url, field) => {
|
|
491
489
|
/**
|
492
490
|
* table API
|
493
491
|
*/
|
494
|
-
const TableAPI = (url) => {
|
492
|
+
const TableAPI = (url, host) => {
|
493
|
+
|
494
|
+
const http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
|
495
495
|
|
496
496
|
return {
|
497
497
|
all(filters) {
|