Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pin events, show pins on elements and create small, normal breadboards #161

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
79eb6fe
when pin is hovered change color
bobikenobi12 Feb 26, 2024
b39a9d6
add small breadboard and select option
bobikenobi12 Feb 26, 2024
b7b38bb
finish normal breadboard pin mappings
bobikenobi12 Feb 27, 2024
76df949
change author
bobikenobi12 Feb 27, 2024
09b1712
modify pin width, height, radius and type
bobikenobi12 Feb 28, 2024
cd2b0c7
pins are visible in actual projects
bobikenobi12 Feb 28, 2024
fc3d7bc
update version
bobikenobi12 Feb 28, 2024
f4b6f07
export show pins as element
bobikenobi12 Feb 28, 2024
caeffd4
add show pin as element
bobikenobi12 Feb 28, 2024
487927c
update version
bobikenobi12 Feb 28, 2024
28dba71
renake small breadboard
bobikenobi12 Mar 3, 2024
54b99f2
redesign of the normal breadboard
bobikenobi12 Mar 3, 2024
047f4a9
new pkg version
bobikenobi12 Mar 3, 2024
9e75d2b
intrinsic elements are now capitalized
bobikenobi12 Mar 3, 2024
4b5c86f
update version
bobikenobi12 Mar 3, 2024
354dc7b
rename components
bobikenobi12 Mar 28, 2024
8fec237
fix package.json conflict
bobikenobi12 Mar 29, 2024
e1d853d
Revert "update version"
bobikenobi12 Mar 29, 2024
e9e3ac9
Revert "update version"
bobikenobi12 Mar 29, 2024
7e25660
add separate main and mcu breaboards
bobikenobi12 Apr 2, 2024
871a266
Merge branch 'dev' of https://github.com/Pupe6/wokwi-elements into dev
bobikenobi12 Apr 2, 2024
f30e94d
update package js
bobikenobi12 Apr 2, 2024
aa2b35b
add show pins element as react type
bobikenobi12 Apr 2, 2024
6bdac7d
update arduino nano and uno story names
bobikenobi12 Apr 2, 2024
37424c5
rename rgb led story
bobikenobi12 Apr 2, 2024
bfed836
add no drag class to prevent dragging
bobikenobi12 Apr 15, 2024
abe7888
update version
bobikenobi12 Apr 15, 2024
775b1c5
add attiny85
bobikenobi12 Apr 16, 2024
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: 0 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ export const parameters = {
import { setCustomElements } from '@storybook/web-components';
import customElements from '../custom-elements.json';

import '../src/utils/show-pins-element';

// Configure Storybook Docs Addon for Web Components
setCustomElements(customElements);
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@wokwi/elements",
"version": "1.4.10",
"name": "@b.borisov/cu-elements",
"version": "1.4.22",
"main": "dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"repository": "https://github.com/wokwi/wokwi-elements",
"author": "Uri Shaked <uri@urishaked.com>",
"repository": "https://github.com/Pupe6/wokwi-elements",
"author": "Borislav Borisov <borislav1207@gmail.com>",
"license": "MIT",
"files": [
"dist"
Expand Down
2 changes: 1 addition & 1 deletion src/arduino-mega-element.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import './arduino-mega-element';
import { action } from '@storybook/addon-actions';

storiesOf('Arduino Mega', module)
.addParameters({ component: 'wokwi-arduino-mega' })
.addParameters({ component: 'ArduinoMegaElement' })
.addDecorator(withKnobs)
.add(
'Mega',
Expand Down
489 changes: 248 additions & 241 deletions src/arduino-mega-element.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/arduino-nano-element.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { action } from '@storybook/addon-actions';
import './arduino-nano-element';

storiesOf('Arduino Nano', module)
.addParameters({ component: 'wokwi-arduino-nano' })
.addParameters({ component: 'ArduinoNanoElement' })
.addDecorator(withKnobs)
.add(
'Nano',
Expand Down
2 changes: 1 addition & 1 deletion src/arduino-uno-element.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { html } from 'lit';
import './arduino-uno-element';

storiesOf('Arduino Uno', module)
.addParameters({ component: 'wokwi-arduino-uno' })
.addParameters({ component: 'ArduinoUnoElement' })
.addDecorator(withKnobs)
.add(
'Uno R3',
Expand Down
1 change: 1 addition & 0 deletions src/assets/SmallBreadboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/attiny85-element.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { html } from 'lit';
import './attiny85-element';

export default {
title: 'Attiny85',
component: 'wokwi-attiny85',
argTypes: {
value: { control: { type: 'number', min: 1, max: 10, step: 1 } },
},
args: {
value: 5,
},
};

const Template = ({ value }) => html`<wokwi-attiny85 value=${value}></wokwi-attiny85>`;

export const Default = Template.bind({});
Default.args = { value: 5 };

export const Large = Template.bind({});
Large.args = { value: 10 };
4,070 changes: 4,070 additions & 0 deletions src/attiny85-element.ts

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions src/breadboard-element.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { html } from 'lit';
import './breadboard-element';

export default {
title: 'Breadboard',
component: 'BreaboardElement',
argTypes: {
type: {
control: {
type: 'select',
options: ['small', 'normal'],
},
},
},
args: {
type: 'normal',
},
};

const Template = ({ type }) => html`
<wokwi-show-pins pinRadius="5" pinType="circle">
<BreadboardElement type=${type}></BreadboardElement>
</wokwi-show-pins>
`;

export const Small = Template.bind({});
Small.args = { type: 'small' };

export const Normal = Template.bind({});
Normal.args = { type: 'normal' };
1,681 changes: 1,681 additions & 0 deletions src/breadboard-element.ts

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ export { StepperMotorElement } from './stepper-motor-element';
export { HX711Element } from './hx711-element';
export { KS2EMDC5Element } from './ks2e-m-dc5-element';
export { BiaxialStepperElement } from './biaxial-stepper-element';
export { BreadboardElement } from './breadboard-element';
export { ShowPinsElement } from './show-pins-element';
export { MainBreadboardElement } from './main-breadboard-element';
export { McuBreadboardElement } from './mcu-breadboard-element';
export { Attiny85Element } from './attiny85-element';
13 changes: 13 additions & 0 deletions src/main-breadboard-element.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { html } from 'lit';
import './main-breadboard-element';

export default {
title: 'Main Breadboard',
component: 'wokwi-main-breadboard',
argTypes: {},
args: {},
};

const Template = () => html`<wokwi-main-breadboard></wokwi-main-breadboard>`;

export const Default = Template.bind({});
1,013 changes: 1,013 additions & 0 deletions src/main-breadboard-element.ts

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/mcu-breadboard-element.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { html } from 'lit';
import './mcu-breadboard-element';

export default {
title: 'Mcu Breadboard',
component: 'wokwi-mcu-breadboard',
argTypes: {},
args: {},
};

const Template = () => html`<wokwi-mcu-breadboard></wokwi-mcu-breadboard>`;

export const Default = Template.bind({});
650 changes: 650 additions & 0 deletions src/mcu-breadboard-element.ts

Large diffs are not rendered by default.

109 changes: 60 additions & 49 deletions src/react-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,62 +50,73 @@ import { StepperMotorElement } from './stepper-motor-element';
import { HX711Element } from './hx711-element';
import { KS2EMDC5Element } from './ks2e-m-dc5-element';
import { BiaxialStepperElement } from './biaxial-stepper-element';
import { BreadboardElement } from './breadboard-element';
import { ShowPinsElement } from './show-pins-element';
import { MainBreadboardElement } from './main-breadboard-element';
import { McuBreadboardElement } from './mcu-breadboard-element';

import type React from 'react';
import { Attiny85Element } from './attiny85-element';

type WokwiElement<T> = Partial<T> & React.ClassAttributes<T>;

declare global {
namespace JSX {
interface IntrinsicElements {
'wokwi-7segment': WokwiElement<SevenSegmentElement>;
'wokwi-arduino-uno': WokwiElement<ArduinoUnoElement>;
'wokwi-lcd1602': WokwiElement<LCD1602Element>;
'wokwi-led': WokwiElement<LEDElement>;
'wokwi-neopixel': WokwiElement<NeoPixelElement>;
'wokwi-pushbutton': WokwiElement<PushbuttonElement>;
'wokwi-resistor': WokwiElement<ResistorElement>;
'wokwi-membrane-keypad': WokwiElement<MembraneKeypadElement>;
'wokwi-potentiometer': WokwiElement<PotentiometerElement>;
'wokwi-neopixel-matrix': WokwiElement<NeopixelMatrixElement>;
'wokwi-ssd1306': WokwiElement<SSD1306Element>;
'wokwi-buzzer': WokwiElement<BuzzerElement>;
'wokwi-rotary-dialer': WokwiElement<RotaryDialerElement>;
'wokwi-servo': WokwiElement<ServoElement>;
'wokwi-dht22': WokwiElement<DHT22Element>;
'wokwi-arduino-mega': WokwiElement<ArduinoMegaElement>;
'wokwi-arduino-nano': WokwiElement<ArduinoNanoElement>;
'wokwi-ds1307': WokwiElement<Ds1307Element>;
'wokwi-neopixel-ring': WokwiElement<LEDRingElement>;
'wokwi-slide-switch': WokwiElement<SlideSwitchElement>;
'wokwi-hc-sr04': WokwiElement<HCSR04Element>;
'wokwi-lcd2004': WokwiElement<LCD2004Element>;
'wokwi-analog-joystick': WokwiElement<AnalogJoystickElement>;
'wokwi-slide-potentiometer': WokwiElement<SlidePotentiometerElement>;
'wokwi-ir-receiver': WokwiElement<IRReceiverElement>;
'wokwi-ir-remote': WokwiElement<IRRemoteElement>;
'wokwi-pir-motion-sensor': WokwiElement<PIRMotionSensorElement>;
'wokwi-ntc-temperature-sensor': WokwiElement<NTCTemperatureSensorElement>;
'wokwi-heart-beat-sensor': WokwiElement<HeartBeatSensorElement>;
'wokwi-tilt-switch': WokwiElement<TiltSwitchElement>;
'wokwi-flame-sensor': WokwiElement<FlameSensorElement>;
'wokwi-gas-sensor': WokwiElement<GasSensorElement>;
'wokwi-franzininho': WokwiElement<FranzininhoElement>;
'wokwi-nano-rp2040-connect': WokwiElement<NanoRP2040ConnectElement>;
'wokwi-small-sound-sensor': WokwiElement<SmallSoundSensorElement>;
'wokwi-big-sound-sensor': WokwiElement<BigSoundSensorElement>;
'wokwi-mpu6050': WokwiElement<MPU6050Element>;
'wokwi-esp32-devkit-v1': WokwiElement<ESP32DevkitV1Element>;
'wokwi-ky-040': WokwiElement<KY040Element>;
'wokwi-photoresistor-sensor': WokwiElement<PhotoresistorSensorElement>;
'wokwi-rgb-led': WokwiElement<RGBLedElement>;
'wokwi-ili9341': WokwiElement<ILI9341Element>;
'wokwi-led-bar-graph': WokwiElement<LedBarGraphElement>;
'wokwi-microsd-card': WokwiElement<MicrosdCardElement>;
'wokwi-dip-switch-8': WokwiElement<DipSwitch8Element>;
'wokwi-stepper-motor': WokwiElement<StepperMotorElement>;
'wokwi-hx711': WokwiElement<HX711Element>;
'wokwi-ks2e-m-dc5': WokwiElement<KS2EMDC5Element>;
'wokwi-biaxial-stepper': WokwiElement<BiaxialStepperElement>;
SevenSegment: WokwiElement<SevenSegmentElement>;
ArduinoUno: WokwiElement<ArduinoUnoElement>;
LCD1602: WokwiElement<LCD1602Element>;
LED: WokwiElement<LEDElement>;
NeoPixel: WokwiElement<NeoPixelElement>;
Pushbutton: WokwiElement<PushbuttonElement>;
Resistor: WokwiElement<ResistorElement>;
MembraneKeypad: WokwiElement<MembraneKeypadElement>;
Potentiometer: WokwiElement<PotentiometerElement>;
NeopixelMatrix: WokwiElement<NeopixelMatrixElement>;
SSD1306: WokwiElement<SSD1306Element>;
Buzzer: WokwiElement<BuzzerElement>;
RotaryDialer: WokwiElement<RotaryDialerElement>;
Servo: WokwiElement<ServoElement>;
DHT22: WokwiElement<DHT22Element>;
ArduinoMega: WokwiElement<ArduinoMegaElement>;
ArduinoNano: WokwiElement<ArduinoNanoElement>;
DS1307: WokwiElement<Ds1307Element>;
LEDRing: WokwiElement<LEDRingElement>;
SlideSwitch: WokwiElement<SlideSwitchElement>;
HCSR04: WokwiElement<HCSR04Element>;
LCD2004: WokwiElement<LCD2004Element>;
AnalogJoystick: WokwiElement<AnalogJoystickElement>;
SlidePotentiometer: WokwiElement<SlidePotentiometerElement>;
IRReceiver: WokwiElement<IRReceiverElement>;
IRRemote: WokwiElement<IRRemoteElement>;
PIRMotionSensor: WokwiElement<PIRMotionSensorElement>;
NTCTemperatureSensor: WokwiElement<NTCTemperatureSensorElement>;
HeartBeatSensor: WokwiElement<HeartBeatSensorElement>;
TiltSwitch: WokwiElement<TiltSwitchElement>;
FlameSensor: WokwiElement<FlameSensorElement>;
GasSensor: WokwiElement<GasSensorElement>;
Franzininho: WokwiElement<FranzininhoElement>;
NanoRP2040Connect: WokwiElement<NanoRP2040ConnectElement>;
SmallSoundSensor: WokwiElement<SmallSoundSensorElement>;
BigSoundSensor: WokwiElement<BigSoundSensorElement>;
MPU6050: WokwiElement<MPU6050Element>;
ESP32DevkitV1: WokwiElement<ESP32DevkitV1Element>;
KY040: WokwiElement<KY040Element>;
PhotoresistorSensor: WokwiElement<PhotoresistorSensorElement>;
RGBLed: WokwiElement<RGBLedElement>;
ILI9341: WokwiElement<ILI9341Element>;
LedBarGraph: WokwiElement<LedBarGraphElement>;
MicrosdCard: WokwiElement<MicrosdCardElement>;
DipSwitch8: WokwiElement<DipSwitch8Element>;
StepperMotor: WokwiElement<StepperMotorElement>;
HX711: WokwiElement<HX711Element>;
KS2EMDC5: WokwiElement<KS2EMDC5Element>;
BiaxialStepper: WokwiElement<BiaxialStepperElement>;
Breadboard: WokwiElement<BreadboardElement>;
ShowPins: WokwiElement<ShowPinsElement>;
MainBreadboard: WokwiElement<MainBreadboardElement>;
MCUBreadboard: WokwiElement<McuBreadboardElement>;
Attiny85: WokwiElement<Attiny85Element>;
}
}
}
33 changes: 33 additions & 0 deletions src/show-pins-element.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { html } from 'lit';
import './show-pins-element';

export default {
title: 'Show Pin',
component: 'wokwi-show-pins',
argTypes: {
pinColor: { control: 'color' },
pinType: { control: { type: 'select', options: ['circle', 'rect'] } },
pinWidth: { control: 'number' },
pinHeight: { control: 'number' },
pinRadius: { control: 'number' },
},
args: {
pinColor: 'transparent',
pinType: 'circle',
pinWidth: 10,
pinHeight: 10,
pinRadius: 10,
},
};

const Template = ({ pinColor, pinType, pinWidth, pinHeight, pinRadius }) => html`<wokwi-show-pins
pinColor=${pinColor}
pinType=${pinType}
pinWidth=${pinWidth}
pinHeight=${pinHeight}
pinRadius=${pinRadius}
>
</wokwi-show-pins>`;

export const Default = Template.bind({});
Default.args = { pinColor: 'transparent' };
Loading