Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9dc66d5
build(masonry): create initial folder structure
Karan-Palan Jun 26, 2024
b36b9f5
docs(masonry): create docs folder and add PRD
Karan-Palan Jun 26, 2024
4b38749
docs(masonry): add DFD for level 1 and level 2
Karan-Palan Jun 26, 2024
78b0d6e
docs(masonry) : add tech-spec
Karan-Palan Jun 26, 2024
9384a72
feat(masonry/playground): add demo workspace and render stack of bricks
Karan-Palan Jun 26, 2024
7efa22f
fix(masonry) : fix lint errors and create src/index.ts
Karan-Palan Jun 26, 2024
d8ec0ed
feat(masonry/playground): add stack made wit divs, SVGs and SVGs with…
Karan-Palan Jul 8, 2024
12493e7
feat(masonry): add brick/model, brick types and create tree for stack…
Karan-Palan Jul 8, 2024
cf0d834
feat(masonry): Add and verify utils/path.ts for SVG Path Generation o…
Karan-Palan Jul 15, 2024
bb83f89
feat(masonry): Add tests in path.spec.ts for Comprehensive Testing of…
Karan-Palan Jul 15, 2024
9f128e0
docs(masonry): fix image path in PRD
Karan-Palan Jul 24, 2024
4585a7a
docs(masonry): initialize storybook
Karan-Palan Jul 24, 2024
4c73a2e
Add brick components making sure that model and view are seperate
Karan-Palan Jul 24, 2024
3d2099e
chore(masonry): modify package.json
Karan-Palan Jul 27, 2024
2078edf
feat(masonry): restructure brick code, add stories and create components
Karan-Palan Jul 27, 2024
09e0b09
fix(masonry): fix brick imports
Karan-Palan Jul 29, 2024
11c2250
fix(masonry): fix errors in path.ts and BrickBlock.ts
Karan-Palan Aug 20, 2024
022f0c2
fix(masonry): rewrite components and render them in storybook
Karan-Palan Aug 20, 2024
224fa18
fix(masonry): Fix bounding box scale error for BrickData.ts
Karan-Palan Aug 21, 2024
47539cf
fix(masonry): Fix bounding box scale error for all bricks
Karan-Palan Aug 21, 2024
aa5ce47
chore(masonry): modify package.json
Karan-Palan Aug 25, 2024
43a177c
feat(masonry): add coords in brick components
Karan-Palan Aug 25, 2024
497b434
build(masonry/playground): setup playground
Karan-Palan Aug 25, 2024
3698be5
feat(masonry/playground): render a dummy brick stack
Karan-Palan Aug 25, 2024
d5122c8
fix(masonry): Add nestLengthY in the constructor
Karan-Palan Aug 25, 2024
9b58c14
docs(masonry): fix lint errors
Karan-Palan Aug 27, 2024
80c3a94
style(masonry): add seperation line in BrickData.tsx
Karan-Palan Aug 27, 2024
6a4a44f
feat(masonry/playground): Create Brick components with movement props
Karan-Palan Sep 2, 2024
c4b54fe
feat(masonry/playground): Add dummy stack data
Karan-Palan Sep 2, 2024
d4d6a5c
feat(masonry/playground): Add Zustand State initialization
Karan-Palan Sep 2, 2024
e222259
feat(masonry): Enable drag and drop for bricks and stack
Karan-Palan Sep 2, 2024
2ee22f9
feat(masonry): Create functionality to attach bricks below the top brick
Karan-Palan Sep 2, 2024
22e94e9
fix(masonry): Fix import in BrickBlock
Karan-Palan Sep 2, 2024
4ca73f9
feat(masonry): Add id property in the final classes and use uuid to g…
Karan-Palan Sep 2, 2024
67bb2e6
feat(masonry): Create brick factory
Karan-Palan Sep 2, 2024
1a72c64
feat(masonry): Add tests for brick factory
Karan-Palan Sep 2, 2024
4fba69d
feat(masonry): Create Brick Warehouse module with functions to add, r…
Karan-Palan Sep 2, 2024
dc63072
feat(masonry): Add missing methods to BrickBlock.ts
Karan-Palan Sep 3, 2024
554b7a0
feat(masonry): Add currentState function for react props in BrickBloc…
Karan-Palan Sep 3, 2024
bf62505
feat(masonry): Update Abstract classes with remaining properties
Karan-Palan Sep 3, 2024
ee77d01
build: update dependencies
Karan-Palan Sep 3, 2024
c12fc15
feat(masonry): Update abstract classes to support connection points
Karan-Palan Sep 3, 2024
efa2b88
fix(masonry): rename collapsed property to folded
Karan-Palan Sep 4, 2024
a385c3a
feat(masonry): Implement all the abstract classes and Final classes f…
Karan-Palan Sep 4, 2024
f52f067
feat(masonry): Implement final classes for BrickExpression and BrickS…
Karan-Palan Sep 4, 2024
e7d681d
feat(masonry): Update brickFactory and its tests according to the upd…
Karan-Palan Sep 4, 2024
b559510
docs(masonry): rename specification folders
meganindya Sep 5, 2024
33e63ec
config(dev): [vscode] update config
meganindya Sep 5, 2024
bca5df1
config(dev): [markdownlint] update old properties
meganindya Sep 5, 2024
81bf7d8
feat(masonry): [brick] update models
meganindya Sep 5, 2024
94e1e28
feat(masonry): [design0/block] update concrete model
meganindya Sep 5, 2024
1aba7b6
Merge pull request #416 from sugarlabs/gsoc-2024/week-11-12-annex
Karan-Palan Sep 5, 2024
ab58664
fix(masonry): Fix issues in the concrete classes and add exports to t…
Karan-Palan Sep 6, 2024
bd52b37
feat(masonry): Update factory and create components
Karan-Palan Sep 6, 2024
f2d9c12
fix(masonry): remove any type in BrickWrapper
Karan-Palan Sep 6, 2024
dfd5501
fix(masonry): Fix errors in Wrapper component and update individual c…
Karan-Palan Sep 7, 2024
54a2598
feat(masonry): [block] modify React component and Storybook stories
meganindya Sep 7, 2024
55c9e86
docs(masonry): Add technical specs for brick and stack
Karan-Palan Sep 8, 2024
d9ab1ee
lint(masonry): [docs] fix linting errors
meganindya Jun 11, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

*storybook.log
6 changes: 1 addition & 5 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@
"tables": true,
// Include headings
"headings": true,
// Include headings
"headers": true,
// Strict length checking
"strict": false,
// Stern length checking
Expand Down Expand Up @@ -118,9 +116,7 @@
// MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
"MD024": {
// Only check sibling headings
"allow_different_nesting": true,
// Only check sibling headings
"siblings_only": false
"siblings_only": true
},

// MD025/single-title/single-h1 - Multiple top-level headings in the same document
Expand Down
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"editor.rulers": [100],
"editor.rulers": [
100
],
"editor.renderWhitespace": "boundary",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"javascript.updateImportsOnFileMove.enabled": "always",
Expand All @@ -25,7 +27,7 @@
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
"editor.wordBasedSuggestions": "off"
},
"[markdown]": {
"editor.wordWrap": "on",
Expand Down
37 changes: 37 additions & 0 deletions modules/masonry/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { UserConfigExport } from 'vite';

import path from 'path';
import { mergeConfig } from 'vite';

// -------------------------------------------------------------------------------------------------

function resolve(rootPath: string) {
return path.resolve(__dirname, '..', rootPath);
}

export default {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(tsx|ts|jsx|js)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
docs: {
autodocs: 'tag',
},
async viteFinal(config: UserConfigExport) {
return mergeConfig(config, {
resolve: {
alias: {
'@': resolve('src'),
'@res': resolve('../../res'),
},
extensions: ['.tsx', '.ts', '.js', '.scss', '.sass', '.json'],
},
});
},
};
13 changes: 13 additions & 0 deletions modules/masonry/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import '@res/scss/base.scss';

export const parameters = {
actions: {
argTypesRegex: '^on[A-Z].*',
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
238 changes: 238 additions & 0 deletions modules/masonry/docs/architecture/MasonryDFD.drawio

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
204 changes: 204 additions & 0 deletions modules/masonry/docs/architecture/Processes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# Processes for Data Flow Diagram

## Level 0: Masonry Framework Communication with MusicBlocks

1. **Load Configuration**:
- Input: Configuration File
- Output: Initialized System

2. **Save Configuration**:
- Input: Current State
- Output: Updated Configuration File

3. **Generate Syntax Tree**:
- Input: Brick Stack Data
- Output: Syntax Tree

4. **Parse Syntax Tree**:
- Input: Syntax Tree
- Output: Executable Actions

## Level 1: Interaction between Brick, Palette, Workspace, and Stack of Bricks

### Bricks

1. **Initialize Brick**:
- Input: Brick Properties
- Output: Initialized Brick

2. **Provide Brick Properties**:
- Input: Brick ID from Workspace
- Output: Brick Properties to Workspace

### Palette

1. **Load Brick List**:
- Input: Configuration Settings
- Output: List of Bricks

2. **Select Brick**:
- Input: Brick Selection
- Output: Selected Brick Properties to Workspace
(How this works is, The palette will have a loaded list of SVGs. When you drag one from palette on
to the workspace, the brick will be created on the workspace whos id matches to the one in brick)

### Workspace

1. **Add Brick to Workspace**:
- Input: Brick Properties from Palette
- Output: Updated Workspace

2. **Update Brick Position**:
- Input: Brick ID and Position Data
- Output: Updated Brick Position in Workspace

3. **Connect Bricks**:
- Input: Brick IDs and Connection Data
- Output: Updated Brick Stack in Workspace

4. **Disconnect Bricks**:
- Input: Brick IDs
- Output: Updated Brick Stack in Workspace

5. **Save Workspace State**:
- Input: Current Workspace Data
- Output: Saved Workspace State

### Stack of Bricks

1. **Initialize Stack**:
- Input: Brick Stack Data
- Output: Initialized Stack

2. **Provide Stack Properties**:
- Input: Stack ID from Workspace
- Output: Stack Properties to Workspace

## Level 2: Detailed Interaction within MVC Architecture

### Model

1. BrickModel:
- Properties:
- brickType
- originalColor
- hoverColor
- disconnectedColor
- executionColor
- highlightState
- shape
- sprites
- labels
- inputPorts
- outputPorts
- editableTextLabels
- Methods:
- setHighlightState(state)
- updateProperties(properties)
- updateLabels(labels)
- updatePorts(inputPorts, outputPorts)
2. StackModel:
- Properties:
- connectedBricks
- startPosition
- validationRules
- collapsibleState
- Methods:
- addBrick(brick)
- removeBrick(brick)
- updateProperties(properties)
- validateStack()
- setCollapsibleState(state)
3. PaletteModel:
- Properties:
- availableBricks
- categories
- searchQuery
- filters
- Methods:
- loadBricks(bricks)
- updateBrickAvailability(brick, available)
- categorizeItems(categories)
- filterItems(filters)
- searchItems(query)
4. WorkspaceModel:
- Properties:
- connectedStacks
- brickPositions
- zoomLevel
- undoRedoStack
- Methods:
- addStack(stack)
- removeStack(stack)
- updateBrickPosition(brick, position)
- connectBricks(brick1, brick2)
- disconnectBricks(brick1, brick2)
- deleteBrick(brick)
- zoomIn()
- zoomOut()
- undo()
- redo()

### View

1. BrickView:
- Methods:
- renderBrick(brick)
- updateBrickAppearance(brick)
- renderInlineTextEditing(brick)
- renderContextMenu(brick)
2. StackView:
- Methods:
- renderStack(stack)
- updateStackAppearance(stack)
- renderValidationFeedback(stack)
- renderCollapsibleState(stack)
3. PaletteView:
- Methods:
- renderPalette(palette)
- updatePaletteAppearance(palette)
- renderCategories(categories)
- renderSearchBar(searchQuery)
- renderFilters(filters)
4. WorkspaceView:
- Methods:
- renderWorkspace(workspace)
- updateWorkspaceAppearance(workspace)
- handleUserInteractions(interaction)
- renderZoomControls(zoomLevel)
- renderUndoRedoButtons(undoRedoStack)

### Controller

1. BrickController:
- Methods:
- handleBrickPropertyChange(brick, properties)
- handleBrickHighlightStateChange(brick, state)
- handleInlineTextEditing(brick, text)
- handleContextMenuAction(brick, action)
2. StackController:
- Methods:
- handleAddBrick(stack, brick)
- handleRemoveBrick(stack, brick)
- handleStackPropertyChange(stack, properties)
- handleStackValidation(stack)
- handleCollapsibleStateChange(stack, state)
3. PaletteController:
- Methods:
- handleBrickLoad(palette, bricks)
- handleBrickAvailabilityChange(palette, brick, available)
- handleCategorization(palette, categories)
- handleFiltering(palette, filters)
- handleSearching(palette, query)
4. WorkspaceController:
- Methods:
- handleAddStack(workspace, stack)
- handleRemoveStack(workspace, stack)
- handleBrickPositionChange(workspace, brick, position)
- handleBrickConnection(workspace, brick1, brick2)
- handleBrickDisconnection(workspace, brick1, brick2)
- handleBrickDeletion(workspace, brick)
- handleZoomIn(workspace)
- handleZoomOut(workspace)
- handleUndo(workspace)
- handleRedo(workspace)
Loading
Loading