Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.env
.DS_Store
undefined
.vscode
.vscode
data.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "make.md",
"main": "main.js",
"scripts": {
"dev": "nnode esbuild.config.mjs",
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"preview": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs preview",
"demo": "&& node esbuild.config.mjs demo",
Expand Down
16 changes: 15 additions & 1 deletion src/core/react/components/Explorer/PropertiesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,34 @@ export const PropertiesView = (props: {
}
};

const pathChanged = (payload: { path: string }) => {
if (payload.path == pathState?.path) {
refreshData();
}
};

useEffect(() => {
refreshData();
props.superstate.eventsDispatcher.addListener(
"contextStateUpdated",
mdbChanged
);
props.superstate.eventsDispatcher.addListener(
"pathStateUpdated",
pathChanged
);

return () => {
props.superstate.eventsDispatcher.removeListener(
"contextStateUpdated",
mdbChanged
);
props.superstate.eventsDispatcher.removeListener(
"pathStateUpdated",
pathChanged
);
};
}, [props.spaces, tableData]);
}, [props.spaces, tableData, pathState]);
const savePropertyValue = (value: string, f: SpaceTableColumn) => {
if (saveProperty) {
const property = tableData?.cols?.find((g) => g.name == f.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ export const OptionCell = (
.map((t, index) => ({
...t,
color: editable
? schemeColors
? t.color?.length > 0
? t.color // Use individual option color if set
: schemeColors
? schemeColors[index % schemeColors.length]?.value ||
"var(--mk-color-none)"
: t.color?.length > 0
? t.color
: undefined
: undefined,
removeable: editable ? editMode >= CellEditMode.EditModeView : false,
Expand Down
5 changes: 3 additions & 2 deletions src/core/react/components/UI/Menus/contexts/PropertyValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,11 @@ export const PropertyValueComponent = (props: {
const options = parseOptions(parsedValue.options ?? []);

const saveOptionsHandler = (newOptions: SelectOption[], colorScheme?: string) => {
saveParsedValue("options", newOptions);
const updated: Record<string, any> = { ...parsedValue, options: newOptions };
if (colorScheme !== undefined) {
saveParsedValue("colorScheme", colorScheme);
updated.colorScheme = colorScheme;
}
props.saveValue(JSON.stringify(updated));
};

props.superstate.ui.openModal(
Expand Down
6 changes: 5 additions & 1 deletion src/core/react/components/UI/Modals/EditOptionsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ const SortableOptionItem: React.FC<SortableOptionItemProps> = ({
e.preventDefault();

// Always show color picker menu regardless of color scheme
showColorPickerMenu(
const menu = showColorPickerMenu(
superstate,
(e.target as HTMLElement).getBoundingClientRect(),
windowFromDocument(e.view.document),
option.color || "var(--mk-color-none)",
(color: string) => {
onEdit({ ...option, color });
// Auto-close menu after color selection
if (menu) {
menu.hide();
}
}
);
};
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"inlineSources": true,
"isolatedModules": true,
"module": "ESNext",
"target": "es6",
"target": "es2020",
"allowJs": true,
"alwaysStrict": true,
"noImplicitAny": true,
Expand Down