@common-stack/components-pro 0.1.21 → 0.1.24
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/lib/index.d.ts +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/index.native.d.ts +1 -0
- package/lib/index.native.js +9 -0
- package/lib/index.native.js.map +1 -0
- package/lib/slot-fill/__tests__/filler-slot.test.d.ts +1 -0
- package/lib/slot-fill/__tests__/filler-slot.test.js +63 -0
- package/lib/slot-fill/__tests__/filler-slot.test.js.map +1 -0
- package/lib/slot-fill/__tests__/slot-features.test.d.ts +1 -0
- package/lib/slot-fill/__tests__/slot-features.test.js +230 -0
- package/lib/slot-fill/__tests__/slot-features.test.js.map +1 -0
- package/lib/slot-fill/base/context.d.ts +6 -0
- package/lib/slot-fill/base/context.js +38 -0
- package/lib/slot-fill/base/context.js.map +1 -0
- package/lib/slot-fill/base/fill.d.ts +10 -0
- package/lib/slot-fill/base/fill.js +65 -0
- package/lib/slot-fill/base/fill.js.map +1 -0
- package/lib/slot-fill/base/provider.d.ts +21 -0
- package/lib/slot-fill/base/provider.js +117 -0
- package/lib/slot-fill/base/provider.js.map +1 -0
- package/lib/slot-fill/base/slot.d.ts +8 -0
- package/lib/slot-fill/base/slot.js +83 -0
- package/lib/slot-fill/base/slot.js.map +1 -0
- package/lib/slot-fill/base/use-slot.d.ts +7 -0
- package/lib/slot-fill/base/use-slot.js +28 -0
- package/lib/slot-fill/base/use-slot.js.map +1 -0
- package/lib/slot-fill/bubbles-virtually/fill.d.ts +5 -0
- package/lib/slot-fill/bubbles-virtually/fill.js +54 -0
- package/lib/slot-fill/bubbles-virtually/fill.js.map +1 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-context.d.ts +4 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-context.js +21 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +4 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-provider.js +112 -0
- package/lib/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -0
- package/lib/slot-fill/bubbles-virtually/slot.d.ts +6 -0
- package/lib/slot-fill/bubbles-virtually/slot.js +61 -0
- package/lib/slot-fill/bubbles-virtually/slot.js.map +1 -0
- package/lib/slot-fill/bubbles-virtually/use-slot.d.ts +2 -0
- package/lib/slot-fill/bubbles-virtually/use-slot.js +32 -0
- package/lib/slot-fill/bubbles-virtually/use-slot.js.map +1 -0
- package/lib/slot-fill/index.d.ts +30 -0
- package/lib/slot-fill/index.js +81 -0
- package/lib/slot-fill/index.js.map +1 -0
- package/lib/slot-fill/index.native.d.ts +16 -0
- package/lib/slot-fill/index.native.js +48 -0
- package/lib/slot-fill/index.native.js.map +1 -0
- package/lib/slot-fill/interfaces/index.d.ts +79 -0
- package/lib/slot-fill/interfaces/index.js +3 -0
- package/lib/slot-fill/interfaces/index.js.map +1 -0
- package/lib/slot-fill/utils/index.d.ts +1 -0
- package/lib/slot-fill/utils/index.js +14 -0
- package/lib/slot-fill/utils/index.js.map +1 -0
- package/lib/slot-fill/utils/isEmptyElement.d.ts +8 -0
- package/lib/slot-fill/utils/isEmptyElement.js +21 -0
- package/lib/slot-fill/utils/isEmptyElement.js.map +1 -0
- package/package.json +5 -4
- package/esm/index.js +0 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createSlotFill = exports.Slot = exports.Provider = exports.Fill = void 0;
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const lodash_1 = require("lodash");
|
|
28
|
+
const slot_1 = __importDefault(require("./base/slot"));
|
|
29
|
+
const fill_1 = __importDefault(require("./base/fill"));
|
|
30
|
+
exports.Fill = fill_1.default;
|
|
31
|
+
const provider_1 = __importDefault(require("./base/provider"));
|
|
32
|
+
exports.Provider = provider_1.default;
|
|
33
|
+
function Slot(props) {
|
|
34
|
+
return React.createElement(slot_1.default, Object.assign({}, lodash_1.omit(props, 'bubblesVirtually')));
|
|
35
|
+
}
|
|
36
|
+
exports.Slot = Slot;
|
|
37
|
+
function createSlotFill(name) {
|
|
38
|
+
const FillComponent = (props) => React.createElement(fill_1.default, Object.assign({ name: name }, props));
|
|
39
|
+
FillComponent.displayName = name + 'Fill';
|
|
40
|
+
const SlotComponent = (props) => React.createElement(Slot, Object.assign({ name: name }, props));
|
|
41
|
+
SlotComponent.displayName = name + 'Slot';
|
|
42
|
+
return {
|
|
43
|
+
Fill: FillComponent,
|
|
44
|
+
Slot: SlotComponent,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
exports.createSlotFill = createSlotFill;
|
|
48
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/slot-fill/index.native.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,mCAA8B;AAC9B,uDAAmC;AACnC,uDAA+B;AAItB,eAJF,cAAI,CAIE;AAHb,+DAAuC;AAGxB,mBAHR,kBAAQ,CAGQ;AAEvB,SAAgB,IAAI,CAAC,KAAiB;IAClC,OAAO,oBAAC,cAAQ,oBAAM,aAAI,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAI,CAAC;AAC9D,CAAC;AAFD,oBAEC;AAED,SAAgB,cAAc,CAAC,IAAI;IAC/B,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,cAAI,kBAAC,IAAI,EAAE,IAAI,IAAM,KAAK,EAAI,CAAC;IACjE,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;IAE1C,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAC,IAAI,kBAAC,IAAI,EAAE,IAAI,IAAM,KAAK,EAAI,CAAC;IACjE,aAAa,CAAC,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;IAE1C,OAAO;QACH,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;KACtB,CAAA;AACL,CAAC;AAXD,wCAWC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactNode, Component } from 'react';
|
|
2
|
+
export declare type Name = string | Symbol;
|
|
3
|
+
export interface IFillProps {
|
|
4
|
+
name: Name;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface IFill extends Component<IFillProps> {
|
|
8
|
+
occurrence: number;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface IContext extends IProviderState {
|
|
12
|
+
}
|
|
13
|
+
export interface IProviderState {
|
|
14
|
+
registerFill: (a: Name, b: any) => void;
|
|
15
|
+
unregisterFill: (a: Name, b: any) => void;
|
|
16
|
+
unregisterSlot: (a: Name, b?: any) => void;
|
|
17
|
+
registerSlot: (a: Name, b?: {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}) => void;
|
|
20
|
+
getSlot: (a: Name) => ISlot;
|
|
21
|
+
getFills: (a: Name, b?: any) => IFill[] | [];
|
|
22
|
+
hasFills: (a: Name) => boolean;
|
|
23
|
+
subscribe: (listener: any) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare type IReactContext = Omit<Partial<IProviderState>, 'registerSlot'> & {
|
|
26
|
+
slots?: any;
|
|
27
|
+
fills?: any;
|
|
28
|
+
updateSlot: (name: Name, fillProps: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}) => void;
|
|
31
|
+
registerSlot: (a: Name, ref: any, b?: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}) => void;
|
|
34
|
+
};
|
|
35
|
+
export interface ISlot extends React.Component<ISlotProps> {
|
|
36
|
+
node: Element;
|
|
37
|
+
}
|
|
38
|
+
export interface ISlotProps {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the component. Use a symbol if you want to be 100% sure the Slot
|
|
41
|
+
* will only be filled by a component you create
|
|
42
|
+
*/
|
|
43
|
+
name: Name;
|
|
44
|
+
/**
|
|
45
|
+
* Props to be applied to the child Element of every fill which has the same name.
|
|
46
|
+
*
|
|
47
|
+
* If the value is a function, it must have the following signature:
|
|
48
|
+
* (target: Fill, fills: Fill[]) => void;
|
|
49
|
+
*
|
|
50
|
+
* This allows you to access props on the fill which invoked the function
|
|
51
|
+
* by using target.props.something()
|
|
52
|
+
*/
|
|
53
|
+
fillProps?: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A an optional function which gets all of the current fills for this slot
|
|
58
|
+
* Allows sorting, or filtering before rendering. An example use-case could
|
|
59
|
+
* be to only show a limited amount of fills.
|
|
60
|
+
*
|
|
61
|
+
* By default Slot injects an unstyled `<div>` element. If you want greater
|
|
62
|
+
* control over presentation use this function.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* <Slot name="My.Slot">
|
|
66
|
+
* {(items) => <Component>{items}</Component>}
|
|
67
|
+
* </Slot>
|
|
68
|
+
*/
|
|
69
|
+
children?: (fills: IFill[]) => JSX.Element;
|
|
70
|
+
bubblesVirtually?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* `Slot` with `bubblesVirtually` set to true also accept an optional `className` to
|
|
73
|
+
* add to the slot container.
|
|
74
|
+
*
|
|
75
|
+
* @type {string}
|
|
76
|
+
* @memberof ISlotProps
|
|
77
|
+
*/
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/slot-fill/interfaces/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './isEmptyElement';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./isEmptyElement"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/slot-fill/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the provided element to check.
|
|
4
|
+
*
|
|
5
|
+
* @param element React Component to check.
|
|
6
|
+
* @returns True when an element is considered empty.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isEmptyElement: (element: React.ComponentElement<any, any> | any) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEmptyElement = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the provided element to check.
|
|
7
|
+
*
|
|
8
|
+
* @param element React Component to check.
|
|
9
|
+
* @returns True when an element is considered empty.
|
|
10
|
+
*/
|
|
11
|
+
const isEmptyElement = (element) => {
|
|
12
|
+
if (lodash_1.isNumber(element)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (lodash_1.isString(element) || lodash_1.isArray(element)) {
|
|
16
|
+
return !element.length;
|
|
17
|
+
}
|
|
18
|
+
return !element;
|
|
19
|
+
};
|
|
20
|
+
exports.isEmptyElement = isEmptyElement;
|
|
21
|
+
//# sourceMappingURL=isEmptyElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmptyElement.js","sourceRoot":"","sources":["../../../src/slot-fill/utils/isEmptyElement.tsx"],"names":[],"mappings":";;;AAEA,mCAAqD;AAErD;;;;;GAKG;AAEI,MAAM,cAAc,GAAG,CAAC,OAA+C,EAAE,EAAE;IAC9E,IAAI,iBAAQ,CAAC,OAAO,CAAC,EAAE;QACnB,OAAO,KAAK,CAAC;KAChB;IAED,IAAI,iBAAQ,CAAC,OAAO,CAAC,IAAI,gBAAO,CAAE,OAAO,CAAC,EAAE;QACxC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;KAC1B;IAED,OAAO,CAAC,OAAO,CAAC;AACpB,CAAC,CAAC;AAVW,QAAA,cAAc,kBAUzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/components-pro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "browser plugin for git",
|
|
5
5
|
"homepage": "https://github.com/cdmbase/fullstack-pro#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "CDMBase LLC",
|
|
15
|
-
"main": "
|
|
16
|
-
"
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"react-native": "lib/index.native.js",
|
|
17
|
+
"typings": "lib/index.d.ts",
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "npm run build:clean && npm run build:lib",
|
|
19
20
|
"build:clean": "rimraf esm",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"publishConfig": {
|
|
48
49
|
"access": "public"
|
|
49
50
|
},
|
|
50
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "1318b4a3b9a55a5ad2a1d12a23264924f0fcb375",
|
|
51
52
|
"typescript": {
|
|
52
53
|
"definition": "lib/index.d.ts"
|
|
53
54
|
}
|
package/esm/index.js
DELETED