@guillotinaweb/react-gmi 0.35.1 → 0.35.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.
- package/dist/react-gmi.js +5 -1
- package/dist/react-gmi.js.map +1 -1
- package/dist/react-gmi.modern.js +46 -41
- package/dist/react-gmi.modern.js.map +1 -1
- package/dist/src/guillo-gmi/components/fields/editComponent.d.ts +2 -1
- package/dist/src/guillo-gmi/components/input/input.d.ts +2 -2
- package/dist/src/guillo-gmi/components/input/input_list.d.ts +2 -2
- package/dist/src/guillo-gmi/components/input/select.d.ts +2 -1
- package/dist/src/guillo-gmi/components/input/select_vocabulary.d.ts +2 -1
- package/dist/src/guillo-gmi/components/input/textarea.d.ts +2 -1
- package/dist/src/guillo-gmi/components/modal.d.ts +2 -1
- package/dist/src/guillo-gmi/components/properties_view.d.ts +3 -2
- package/dist/src/guillo-gmi/components/selected_items_actions.d.ts +2 -1
- package/dist/src/guillo-gmi/contexts/index.d.ts +4 -4
- package/dist/src/guillo-gmi/models/sharing.d.ts +4 -3
- package/package.json +1 -1
package/dist/react-gmi.modern.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as m from "react";
|
|
2
2
|
import React, { Children, Component, Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import ReactDOM, { createPortal, flushSync } from "react-dom";
|
|
5
5
|
import { IntlProvider, defineMessages, useIntl } from "react-intl";
|
|
6
6
|
//#region \0rolldown/runtime.js
|
|
7
7
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
9
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
10
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
11
|
-
});
|
|
12
8
|
//#endregion
|
|
13
9
|
//#region src/guillo-gmi/reducers/guillotina.ts
|
|
14
10
|
var initialState$4 = {
|
|
@@ -3535,6 +3531,11 @@ function applyMiddleware(...middlewares) {
|
|
|
3535
3531
|
};
|
|
3536
3532
|
}
|
|
3537
3533
|
//#endregion
|
|
3534
|
+
//#region builtin:esm-external-require-react
|
|
3535
|
+
var require_builtin_esm_external_require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3536
|
+
module.exports = { ...m };
|
|
3537
|
+
}));
|
|
3538
|
+
//#endregion
|
|
3538
3539
|
//#region node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js
|
|
3539
3540
|
/**
|
|
3540
3541
|
* @license React
|
|
@@ -3546,11 +3547,11 @@ function applyMiddleware(...middlewares) {
|
|
|
3546
3547
|
* LICENSE file in the root directory of this source tree.
|
|
3547
3548
|
*/
|
|
3548
3549
|
var require_use_sync_external_store_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3549
|
-
var React
|
|
3550
|
+
var React = require_builtin_esm_external_require_react();
|
|
3550
3551
|
function is(x, y) {
|
|
3551
3552
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
3552
3553
|
}
|
|
3553
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React
|
|
3554
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
3554
3555
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
3555
3556
|
var instRef = useRef(null);
|
|
3556
3557
|
if (null === instRef.current) {
|
|
@@ -3617,7 +3618,7 @@ var require_use_sync_external_store_with_selector_development = /* @__PURE__ */
|
|
|
3617
3618
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
3618
3619
|
}
|
|
3619
3620
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
3620
|
-
var React =
|
|
3621
|
+
var React = require_builtin_esm_external_require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
|
|
3621
3622
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
3622
3623
|
var instRef = useRef(null);
|
|
3623
3624
|
if (null === instRef.current) {
|
|
@@ -3673,7 +3674,7 @@ var require_use_sync_external_store_with_selector_development = /* @__PURE__ */
|
|
|
3673
3674
|
if (process.env.NODE_ENV === "production") module.exports = require_use_sync_external_store_with_selector_production();
|
|
3674
3675
|
else module.exports = require_use_sync_external_store_with_selector_development();
|
|
3675
3676
|
})))();
|
|
3676
|
-
var IS_REACT_19 = /* @__PURE__ */
|
|
3677
|
+
var IS_REACT_19 = /* @__PURE__ */ m.version.startsWith("19");
|
|
3677
3678
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(IS_REACT_19 ? "react.transitional.element" : "react.element");
|
|
3678
3679
|
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
3679
3680
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -4008,7 +4009,7 @@ var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document
|
|
|
4008
4009
|
var isDOM = /* @__PURE__ */ canUseDOM();
|
|
4009
4010
|
var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
4010
4011
|
var isReactNative = /* @__PURE__ */ isRunningInReactNative();
|
|
4011
|
-
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ?
|
|
4012
|
+
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? m.useLayoutEffect : m.useEffect;
|
|
4012
4013
|
var useIsomorphicLayoutEffect$1 = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
|
|
4013
4014
|
function is(x, y) {
|
|
4014
4015
|
if (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
@@ -4099,13 +4100,13 @@ function hoistNonReactStatics(targetComponent, sourceComponent) {
|
|
|
4099
4100
|
var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);
|
|
4100
4101
|
var gT = typeof globalThis !== "undefined" ? globalThis : {};
|
|
4101
4102
|
function getContext() {
|
|
4102
|
-
if (!
|
|
4103
|
+
if (!m.createContext) return {};
|
|
4103
4104
|
const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();
|
|
4104
|
-
let realContext = contextMap.get(
|
|
4105
|
+
let realContext = contextMap.get(m.createContext);
|
|
4105
4106
|
if (!realContext) {
|
|
4106
|
-
realContext =
|
|
4107
|
+
realContext = m.createContext(null);
|
|
4107
4108
|
if (process.env.NODE_ENV !== "production") realContext.displayName = "ReactRedux";
|
|
4108
|
-
contextMap.set(
|
|
4109
|
+
contextMap.set(m.createContext, realContext);
|
|
4109
4110
|
}
|
|
4110
4111
|
return realContext;
|
|
4111
4112
|
}
|
|
@@ -4200,7 +4201,7 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areSta
|
|
|
4200
4201
|
areMergedPropsEqual
|
|
4201
4202
|
};
|
|
4202
4203
|
function ConnectFunction(props) {
|
|
4203
|
-
const [propsContext, reactReduxForwardedRef, wrapperProps] =
|
|
4204
|
+
const [propsContext, reactReduxForwardedRef, wrapperProps] = m.useMemo(() => {
|
|
4204
4205
|
const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props;
|
|
4205
4206
|
return [
|
|
4206
4207
|
props.context,
|
|
@@ -4208,26 +4209,26 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areSta
|
|
|
4208
4209
|
wrapperProps2
|
|
4209
4210
|
];
|
|
4210
4211
|
}, [props]);
|
|
4211
|
-
const ContextToUse =
|
|
4212
|
+
const ContextToUse = m.useMemo(() => {
|
|
4212
4213
|
let ResultContext = Context;
|
|
4213
4214
|
if (propsContext?.Consumer) {
|
|
4214
4215
|
if (process.env.NODE_ENV !== "production") {
|
|
4215
|
-
if (!/* @__PURE__ */ isContextConsumer(/* @__PURE__ */
|
|
4216
|
+
if (!/* @__PURE__ */ isContextConsumer(/* @__PURE__ */ m.createElement(propsContext.Consumer, null))) throw new Error("You must pass a valid React context consumer as `props.context`");
|
|
4216
4217
|
ResultContext = propsContext;
|
|
4217
4218
|
}
|
|
4218
4219
|
}
|
|
4219
4220
|
return ResultContext;
|
|
4220
4221
|
}, [propsContext, Context]);
|
|
4221
|
-
const contextValue =
|
|
4222
|
+
const contextValue = m.useContext(ContextToUse);
|
|
4222
4223
|
const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);
|
|
4223
4224
|
const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);
|
|
4224
4225
|
if (process.env.NODE_ENV !== "production" && !didStoreComeFromProps && !didStoreComeFromContext) throw new Error(`Could not find "store" in the context of "${displayName}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`);
|
|
4225
4226
|
const store = didStoreComeFromProps ? props.store : contextValue.store;
|
|
4226
4227
|
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;
|
|
4227
|
-
const childPropsSelector =
|
|
4228
|
+
const childPropsSelector = m.useMemo(() => {
|
|
4228
4229
|
return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);
|
|
4229
4230
|
}, [store]);
|
|
4230
|
-
const [subscription, notifyNestedSubs] =
|
|
4231
|
+
const [subscription, notifyNestedSubs] = m.useMemo(() => {
|
|
4231
4232
|
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;
|
|
4232
4233
|
const subscription2 = createSubscription(store, didStoreComeFromProps ? void 0 : contextValue.subscription);
|
|
4233
4234
|
return [subscription2, subscription2.notifyNestedSubs.bind(subscription2)];
|
|
@@ -4236,7 +4237,7 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areSta
|
|
|
4236
4237
|
didStoreComeFromProps,
|
|
4237
4238
|
contextValue
|
|
4238
4239
|
]);
|
|
4239
|
-
const overriddenContextValue =
|
|
4240
|
+
const overriddenContextValue = m.useMemo(() => {
|
|
4240
4241
|
if (didStoreComeFromProps) return contextValue;
|
|
4241
4242
|
return {
|
|
4242
4243
|
...contextValue,
|
|
@@ -4247,26 +4248,26 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areSta
|
|
|
4247
4248
|
contextValue,
|
|
4248
4249
|
subscription
|
|
4249
4250
|
]);
|
|
4250
|
-
const lastChildProps =
|
|
4251
|
-
const lastWrapperProps =
|
|
4252
|
-
const childPropsFromStoreUpdate =
|
|
4253
|
-
const renderIsScheduled =
|
|
4254
|
-
const isMounted =
|
|
4255
|
-
const latestSubscriptionCallbackError =
|
|
4251
|
+
const lastChildProps = m.useRef(void 0);
|
|
4252
|
+
const lastWrapperProps = m.useRef(wrapperProps);
|
|
4253
|
+
const childPropsFromStoreUpdate = m.useRef(void 0);
|
|
4254
|
+
const renderIsScheduled = m.useRef(false);
|
|
4255
|
+
const isMounted = m.useRef(false);
|
|
4256
|
+
const latestSubscriptionCallbackError = m.useRef(void 0);
|
|
4256
4257
|
useIsomorphicLayoutEffect$1(() => {
|
|
4257
4258
|
isMounted.current = true;
|
|
4258
4259
|
return () => {
|
|
4259
4260
|
isMounted.current = false;
|
|
4260
4261
|
};
|
|
4261
4262
|
}, []);
|
|
4262
|
-
const actualChildPropsSelector =
|
|
4263
|
+
const actualChildPropsSelector = m.useMemo(() => {
|
|
4263
4264
|
const selector = () => {
|
|
4264
4265
|
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) return childPropsFromStoreUpdate.current;
|
|
4265
4266
|
return childPropsSelector(store.getState(), wrapperProps);
|
|
4266
4267
|
};
|
|
4267
4268
|
return selector;
|
|
4268
4269
|
}, [store, wrapperProps]);
|
|
4269
|
-
const subscribeForReact =
|
|
4270
|
+
const subscribeForReact = m.useMemo(() => {
|
|
4270
4271
|
const subscribe = (reactListener) => {
|
|
4271
4272
|
if (!subscription) return () => {};
|
|
4272
4273
|
return subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener);
|
|
@@ -4283,7 +4284,7 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areSta
|
|
|
4283
4284
|
]);
|
|
4284
4285
|
let actualChildProps;
|
|
4285
4286
|
try {
|
|
4286
|
-
actualChildProps =
|
|
4287
|
+
actualChildProps = m.useSyncExternalStore(subscribeForReact, actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector);
|
|
4287
4288
|
} catch (err) {
|
|
4288
4289
|
if (latestSubscriptionCallbackError.current) err.message += `
|
|
4289
4290
|
The error may be correlated with this previous error:
|
|
@@ -4297,8 +4298,8 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
4297
4298
|
childPropsFromStoreUpdate.current = void 0;
|
|
4298
4299
|
lastChildProps.current = actualChildProps;
|
|
4299
4300
|
});
|
|
4300
|
-
const renderedWrappedComponent =
|
|
4301
|
-
return /* @__PURE__ */
|
|
4301
|
+
const renderedWrappedComponent = m.useMemo(() => {
|
|
4302
|
+
return /* @__PURE__ */ m.createElement(WrappedComponent, {
|
|
4302
4303
|
...actualChildProps,
|
|
4303
4304
|
ref: reactReduxForwardedRef
|
|
4304
4305
|
});
|
|
@@ -4307,8 +4308,8 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
4307
4308
|
WrappedComponent,
|
|
4308
4309
|
actualChildProps
|
|
4309
4310
|
]);
|
|
4310
|
-
return
|
|
4311
|
-
if (shouldHandleStateChanges) return /* @__PURE__ */
|
|
4311
|
+
return m.useMemo(() => {
|
|
4312
|
+
if (shouldHandleStateChanges) return /* @__PURE__ */ m.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);
|
|
4312
4313
|
return renderedWrappedComponent;
|
|
4313
4314
|
}, [
|
|
4314
4315
|
ContextToUse,
|
|
@@ -4316,12 +4317,12 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
4316
4317
|
overriddenContextValue
|
|
4317
4318
|
]);
|
|
4318
4319
|
}
|
|
4319
|
-
const Connect =
|
|
4320
|
+
const Connect = m.memo(ConnectFunction);
|
|
4320
4321
|
Connect.WrappedComponent = WrappedComponent;
|
|
4321
4322
|
Connect.displayName = ConnectFunction.displayName = displayName;
|
|
4322
4323
|
if (forwardRef) {
|
|
4323
|
-
const forwarded =
|
|
4324
|
-
return /* @__PURE__ */
|
|
4324
|
+
const forwarded = m.forwardRef(function forwardConnectRef(props, ref) {
|
|
4325
|
+
return /* @__PURE__ */ m.createElement(Connect, {
|
|
4325
4326
|
...props,
|
|
4326
4327
|
reactReduxForwardedRef: ref
|
|
4327
4328
|
});
|
|
@@ -4337,7 +4338,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
4337
4338
|
var connect_default = connect;
|
|
4338
4339
|
function Provider(providerProps) {
|
|
4339
4340
|
const { children, context, serverState, store } = providerProps;
|
|
4340
|
-
const contextValue =
|
|
4341
|
+
const contextValue = m.useMemo(() => {
|
|
4341
4342
|
const baseContextValue = {
|
|
4342
4343
|
store,
|
|
4343
4344
|
subscription: createSubscription(store),
|
|
@@ -4352,7 +4353,7 @@ function Provider(providerProps) {
|
|
|
4352
4353
|
});
|
|
4353
4354
|
}
|
|
4354
4355
|
}, [store, serverState]);
|
|
4355
|
-
const previousState =
|
|
4356
|
+
const previousState = m.useMemo(() => store.getState(), [store]);
|
|
4356
4357
|
useIsomorphicLayoutEffect$1(() => {
|
|
4357
4358
|
const { subscription } = contextValue;
|
|
4358
4359
|
subscription.onStateChange = subscription.notifyNestedSubs;
|
|
@@ -4364,7 +4365,7 @@ function Provider(providerProps) {
|
|
|
4364
4365
|
};
|
|
4365
4366
|
}, [contextValue, previousState]);
|
|
4366
4367
|
const Context = context || ReactReduxContext;
|
|
4367
|
-
return /* @__PURE__ */
|
|
4368
|
+
return /* @__PURE__ */ m.createElement(Context.Provider, { value: contextValue }, children);
|
|
4368
4369
|
}
|
|
4369
4370
|
var Provider_default = Provider;
|
|
4370
4371
|
//#endregion
|
|
@@ -10831,7 +10832,11 @@ var prepareData = (result) => {
|
|
|
10831
10832
|
const addons = arrayToObject(result.available);
|
|
10832
10833
|
return {
|
|
10833
10834
|
available: result.available.filter((item) => !result.installed.includes(item.id)),
|
|
10834
|
-
installed: result.installed.map((id) => addons[id]
|
|
10835
|
+
installed: result.installed.map((id) => addons[id] ?? {
|
|
10836
|
+
id,
|
|
10837
|
+
title: id,
|
|
10838
|
+
dependencies: []
|
|
10839
|
+
})
|
|
10835
10840
|
};
|
|
10836
10841
|
};
|
|
10837
10842
|
var arrayToObject = (array) => array.reduce((obj, item) => {
|