Skip to content

Commit 536477c

Browse files
committed
Synced and resolved conflicts.
2 parents ee5651d + 7146d3a commit 536477c

File tree

26 files changed

+350
-240
lines changed

26 files changed

+350
-240
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ You can access Openblocks from [cloud-hosted version](https://cloud.openblocks.d
8181
- [File upload with REST API](https://cloud.openblocks.dev/apps/63a2651e660ad97d59eb4a51/view)
8282
- [Shopping cart demo using transformers/state/drawer](https://cloud.openblocks.dev/apps/63a422a344075b798fe3ae06/view)
8383
- [Module demo: color picker](https://cloud.openblocks.dev/apps/63a58f1e85d4cb49cebad1d4/view)
84+
- [S3 File Management](https://cloud.openblocks.dev/apps/63c7aa55686c4f301cf4d755/view)

client/packages/create-openblocks-plugin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
import fs from "fs-extra";
33
import path from "node:path";
4-
import { spawn } from "node:child_process";
4+
import { spawn } from "cross-spawn";
55
import { writeFileSync, existsSync } from "node:fs";
66
import chalk from "chalk";
77
import { createCommand } from "commander";

client/packages/create-openblocks-plugin/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "create-openblocks-plugin",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"bin": "./index.js",
55
"type": "module",
66
"dependencies": {
77
"chalk": "4",
88
"commander": "^9.4.1",
9+
"cross-spawn": "^7.0.3",
910
"fs-extra": "^10.1.0",
1011
"openblocks-dev-utils": "workspace:^"
1112
},

client/packages/openblocks-cli/actions/init.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "path";
22
import fs from "fs-extra";
3-
import { spawn } from "child_process";
3+
import { spawn } from "cross-spawn";
44
import paths from "../config/paths.js";
55
import { createRequire } from "node:module";
66
const require = createRequire(import.meta.url);
@@ -84,9 +84,9 @@ export default async function initAction(options) {
8484

8585
const notCopiedFiles = ["package.json", "README.md", "README-template.md", "node_modules"];
8686
fs.copySync(templateDir, "./", {
87-
filter: (src) => notCopiedFiles.every((i) => !src.startsWith(`${templateDir}/${i}`)),
87+
filter: (src) => notCopiedFiles.every((i) => !src.startsWith(path.join(templateDir, i))),
8888
});
89-
fs.copyFile(`${templateDir}/README-template.md`, "./README.md");
89+
fs.copyFile(path.join(templateDir, "README-template.md"), "./README.md");
9090
console.log("template files copied");
9191

9292
const dependencies = [];

client/packages/openblocks-cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "openblocks-cli",
33
"description": "CLI tool used to start build publish openblocks components",
4-
"version": "0.0.22",
4+
"version": "0.0.24",
55
"bin": "./index.js",
66
"type": "module",
77
"exports": {
@@ -26,6 +26,7 @@
2626
"axios": "^1.1.3",
2727
"chalk": "4",
2828
"commander": "^9.4.1",
29+
"cross-spawn": "^7.0.3",
2930
"fs-extra": "^10.1.0",
3031
"openblocks-dev-utils": "workspace:^",
3132
"react": "^17",
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { Typography } from "antd";
2+
import React from "react";
3+
import styled from "styled-components";
4+
5+
const AntdTypographyText = styled(Typography.Text)`
6+
font-size: 14px;
7+
color: #333333;
8+
line-height: 14px;
9+
overflow: hidden;
10+
text-overflow: ellipsis;
11+
display: block;
12+
13+
:is(.ant-typography-edit-content) {
14+
color: red;
15+
padding: unset;
16+
margin: unset !important;
17+
left: unset;
18+
}
19+
20+
.ant-input,
21+
.ant-input:focus,
22+
.ant-input-focused {
23+
height: 24px !important;
24+
min-height: 24px;
25+
background: #ffffff;
26+
border: 1px solid #3377ff;
27+
border-radius: 4px;
28+
padding: 4px 8px;
29+
margin: -5px 0 3px -9px;
30+
white-space: nowrap;
31+
32+
font-size: 14px;
33+
color: #333333;
34+
line-height: 14px;
35+
36+
::-webkit-scrollbar {
37+
display: none;
38+
}
39+
}
40+
`;
41+
42+
export const TypographyText = (props: {
43+
value: string;
44+
editing: boolean;
45+
onChange: (value: string) => void;
46+
}) => (
47+
<AntdTypographyText
48+
title={props.value}
49+
ellipsis={true}
50+
editable={{
51+
enterIcon: null,
52+
tooltip: false,
53+
editing: props.editing,
54+
icon: null,
55+
triggerType: ["text"],
56+
onChange: props.onChange,
57+
}}
58+
>
59+
{props.value}
60+
</AntdTypographyText>
61+
);

client/packages/openblocks/src/components/layout/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const SideBarV2 = styled(SideBar)`
2222
.sidebar-section:not(:last-child)::after {
2323
content: "";
2424
display: block;
25-
width: 192px;
25+
width: 204px;
2626
height: 1px;
2727
background-color: #ebebeb;
2828
margin: 0 auto 4px;

client/packages/openblocks/src/components/layout/SideBarItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Wrapper = styled.div<{ size?: SideBarSize; selected?: boolean }>`
1212
border-radius: 4px;
1313
display: flex;
1414
align-items: center;
15-
padding: 0 26px;
15+
padding: 0 8px 0 26px;
1616
cursor: pointer;
1717
1818
:hover {

client/packages/openblocks/src/components/table/EditableCell.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,3 @@ export function EditableCell<T extends JSONValue>(props: EditableCellProps<T>) {
129129
</ColumnTypeView>
130130
);
131131
}
132-
133-
export function updateChangeValueFn<T extends JSONValue>(
134-
dispatch: DispatchType,
135-
equalOriginFn: (value: T) => boolean
136-
) {
137-
return (value: T) => {
138-
dispatch(changeChildAction("changeValue", equalOriginFn(value) ? null : value));
139-
};
140-
}

client/packages/openblocks/src/comps/comps/moduleComp/moduleComp.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,21 +281,22 @@ class ModuleTmpComp extends ModuleCompBase {
281281
this.dispatch(customAction<ModuleReadyAction>({ type: "moduleReady", comp }));
282282
});
283283

284-
return setFieldsNoTypeCheck(this, { moduleRootComp, moduleDsl });
284+
return setFieldsNoTypeCheck(this, { moduleDsl });
285285
}
286286

287287
// module ready
288288
if (isMyCustomAction<ModuleReadyAction>(action, "moduleReady")) {
289-
if (!this.moduleRootComp) {
289+
const moduleRootComp = action.value.comp;
290+
if (!moduleRootComp) {
290291
return this;
291292
}
292293

293294
let updateFields: Record<string, any> = {
294295
isReady: true,
295-
moduleRootComp: action.value.comp,
296+
moduleRootComp,
296297
};
297298

298-
const moduleLayoutComp = this.moduleRootComp.children.ui.getModuleLayoutComp();
299+
const moduleLayoutComp = moduleRootComp.children.ui.getModuleLayoutComp();
299300
if (moduleLayoutComp) {
300301
const inputs = moduleLayoutComp.getInputs().map((i) => i.getView());
301302
const inputChild = this.children.inputs.setInputs(inputs);

0 commit comments

Comments
 (0)