Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

HTML Pin Adapter 🎉 #508

Merged
merged 86 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a0c37b4
feat: create wrappers over elements with data-superviz-id
Raspincel Jan 3, 2024
31259be
feat: watch data-attribute changes with mutation observer
Raspincel Jan 3, 2024
8476676
feat: add temporary pin when clicking on element
Raspincel Jan 3, 2024
579ea56
feat: add pin to element
Raspincel Jan 3, 2024
6eb16f0
feat: remove temporary pin when pressing Escape
Raspincel Jan 3, 2024
c40ab04
feat: focus on pin when creating on clicking on pin/annotation
Raspincel Jan 3, 2024
7a546da
feat: display or hide pins according to changes in data-superviz-id
Raspincel Jan 3, 2024
bfe9c15
feat: adapt wrapper size to element size
Raspincel Jan 4, 2024
14967e0
fix: append temporary pin to wrapper instead of element
Raspincel Jan 4, 2024
8203a5a
fix: render temporary pin in other wrapper so input that overflows is…
Raspincel Jan 5, 2024
6fb0f10
refactor: reestructure, comment and organize code
Raspincel Jan 5, 2024
5d3319f
fix: position pin exactly at mouse pointer
Raspincel Jan 5, 2024
d472687
fix: remove pin from element if element loses data-attribute
Raspincel Jan 5, 2024
a4c4cc9
fix: toggle sidebar if clicking on pin when sidebar is closed
Raspincel Jan 5, 2024
a4222c4
fix: stop observing resize only if element loses data-superviz-id att…
Raspincel Jan 5, 2024
a6e11e3
feat: create public method to translate the pins over an element
Raspincel Jan 6, 2024
8d06252
feat: append all wrappers to a single div inside the specified container
Raspincel Jan 6, 2024
29aa1c6
feat: create tests for html-pin-adapter
Raspincel Jan 8, 2024
8ab06ef
feat: add new type to html pin adapter
Raspincel Jan 8, 2024
ca7208e
feat: create public method to scale and translate the entire pins con…
Raspincel Jan 8, 2024
8365d11
feat: update pins positions on scroll
Raspincel Jan 8, 2024
3513baf
fix: stop showing comments over delete modal
Raspincel Jan 8, 2024
d6b5922
feat: create test for onScroll callback
Raspincel Jan 8, 2024
2ed4924
fix: remove pin from element even if element does not have the specif…
Raspincel Jan 8, 2024
27b66af
fix: toggle annotation active attribute when clicking on it multiple …
Raspincel Jan 8, 2024
adeea4c
feat: set high z-indexes to comments button and sidebar and to modals
Raspincel Jan 8, 2024
9e22f30
feat: set z-index to pins container
Raspincel Jan 8, 2024
56d86cd
fix: set selectPin to null when removing data-attribute
Raspincel Jan 8, 2024
853a4aa
fix: pass options to html pin constructor inside an object
Raspincel Jan 8, 2024
456f103
fix: set to undefined instead of using keyword delete
Raspincel Jan 8, 2024
88c059f
feat: remove elements from scroll watch list if they're not useful an…
Raspincel Jan 8, 2024
5622bcb
feat: throw error in case of invalid dataAttributeName
Raspincel Jan 8, 2024
157f959
feat: give initializer to html pin constructor second parameter
Raspincel Jan 8, 2024
236fd8f
feat: create pins wrappers as children or siblings of elements
Raspincel Jan 9, 2024
c9ff9ef
feat: allow user to specify a pattern of the specified data attribute…
Raspincel Jan 9, 2024
09cdae2
Merge pull request #492 from SuperViz/feat/html-pin
carlossantos74 Jan 9, 2024
b22519f
fix: do not show 'Click to Follow' if other participant or user is no…
Raspincel Jan 10, 2024
c79e944
fix: do not show presence mouse over wio
Raspincel Jan 10, 2024
49ddddf
fix: base participant type
carlossantos74 Jan 10, 2024
5bf8f14
ci: remove sonar from checks
carlossantos74 Jan 10, 2024
88fec02
refactor: use types or interfaces instead of casting with 'as'
Raspincel Jan 10, 2024
9936ae0
feat: rename option name in HTML Pin constructor
Raspincel Jan 10, 2024
9d7f403
Merge pull request #495 from SuperViz/ci/remove-sonar
carlossantos74 Jan 10, 2024
fc83b19
fix: use correct pin url
Raspincel Jan 11, 2024
f4c7d36
fix: do not hide pins that go beyond element rect with overflow: hidden
Raspincel Jan 11, 2024
d7ba44a
fix: prevent error being thrown when destroying html pin
Raspincel Jan 11, 2024
d806203
Merge pull request #494 from SuperViz/fix/wio-interaction-with-presence
carlossantos74 Jan 11, 2024
5ecbf1b
feat: calculate pin position in html based on the ratio of where it w…
Raspincel Jan 11, 2024
e7f9631
fix: remove console
Raspincel Jan 11, 2024
4bee8e7
fix: stop multiplying pin position by 100 in types other than html
Raspincel Jan 11, 2024
affb0dd
Merge pull request #497 from SuperViz/feat/position-pins-keep-ratio
carlossantos74 Jan 11, 2024
825676b
fix: correctly position pin if transform: scale() was applied on element
Raspincel Jan 11, 2024
5d26848
Merge pull request #498 from SuperViz/fix/pin-position-on-scale
carlossantos74 Jan 12, 2024
45ccda2
feat: render add cursor through css implementation instead of html el…
Raspincel Jan 12, 2024
68f395e
fix: remove previous mouseElement tests
Raspincel Jan 12, 2024
040b016
feat: hide temporary pin and unselect pins when toggling sidebar
Raspincel Jan 12, 2024
14fe46e
Merge branch 'lab' of https://github.com/SuperViz/sdk into fix/pin-po…
Raspincel Jan 12, 2024
7d1836d
Merge pull request #500 from SuperViz/feat/render-cursor-with-css
carlossantos74 Jan 12, 2024
8c96dea
feat: add flag to show/hide audience list
carlossantos74 Jan 14, 2024
efbfec1
fix: update comments position and fix creating first comment
afonsovinicius Jan 15, 2024
d81a8df
Merge pull request #501 from SuperViz/feat/show-audience-list-flag
Raspincel Jan 15, 2024
6090bcc
Merge pull request #502 from SuperViz/fix/update-comments-wrapper-pos…
carlossantos74 Jan 15, 2024
18e04e1
feat: notify main channel when the participant data is updated
carlossantos74 Jan 15, 2024
b08995f
feat(HTMLPin): hide temporary pin if clicking anywhere else on the sc…
Raspincel Jan 15, 2024
ac61e72
ci: add beta and lab release channels on npm
carlossantos74 Jan 15, 2024
a048eb9
ci(checks): when run checkes delete previus superviz-dev comments
carlossantos74 Jan 15, 2024
2abd39b
feat: emit flag to not call go to pin when creating annotation
Raspincel Jan 15, 2024
6cdac50
fix(CanvasPin): do not go to pin when creating annotation
Raspincel Jan 15, 2024
548a087
feat: hide temporary pin if clicking anywhere else on the screen
Raspincel Jan 15, 2024
4321871
fix: correct tests
Raspincel Jan 15, 2024
17b9274
Merge pull request #505 from SuperViz/feat/hide-temp-pin-click
carlossantos74 Jan 15, 2024
c7ba576
Merge pull request #504 from SuperViz/ci/add-beta-and-lab-package
carlossantos74 Jan 15, 2024
8385977
feat: ensure that only one room is open per browser
carlossantos74 Jan 16, 2024
02626ba
fix: limit how much participants dropdown can grow and add scrollbar …
Raspincel Jan 16, 2024
059a98e
Merge pull request #506 from SuperViz/ci/add-beta-and-lab-package
carlossantos74 Jan 16, 2024
1c7f36d
Merge pull request #507 from SuperViz/fix/limit-max-size-dropdown
carlossantos74 Jan 16, 2024
f9a48dd
fix: only hide temporary pin if current wrapper was not clicked
Raspincel Jan 16, 2024
78dfa1c
feat(HTMLPin): support rect and ellipse svg elements
Raspincel Jan 17, 2024
9bf2772
fix: remove unecessary scroll
Raspincel Jan 17, 2024
592ad36
fix: remove same account check from core
carlossantos74 Jan 17, 2024
bd0e7d7
Merge pull request #513 from SuperViz/fix/same-account-error
carlossantos74 Jan 17, 2024
6e9151d
fix: correct tests
Raspincel Jan 17, 2024
1a8010b
Merge pull request #512 from SuperViz/feat/html-pin-svg-support
carlossantos74 Jan 18, 2024
a56b5cf
fix: position pin correctly on scroll
Raspincel Jan 18, 2024
2f171c5
fix: remove colors
Raspincel Jan 18, 2024
8678434
Merge pull request #516 from SuperViz/fix/html-pin-svg-scroll
carlossantos74 Jan 18, 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
18 changes: 7 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ on:
- opened
- synchronize
jobs:
sonarcloud:
name: SonarCloud
delete-comments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: izhangzhihao/delete-comment@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: SuperViz-Dev
issue_number: ${{ github.event.number }}
test-unit:
runs-on: ubuntu-latest
steps:
Expand All @@ -32,7 +28,7 @@ jobs:
touch .version.js && echo "echo \"export const version = 'test'\" > .version.js" | bash -
- name: Create a .remote-config.js file
run: |
touch .remote-config.js && echo "echo \"export default { apiUrl: 'https://localhost:3000', conferenceLayerUrl: 'https://localhost:8080' }\" > .remote-config.js" | bash -
touch .remote-config.js && echo "echo \"export default { apiUrl: 'https://localhost:3000', conferenceLayerUrl: 'https://localhost:8080' }\" > .remote-config.js" | bash -
- name: Run tests
run: yarn test:unit:ci --coverage
- name: Code Coverage Report
Expand Down
137 changes: 0 additions & 137 deletions .github/workflows/ci.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/publish-beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Beta Version
on:
push:
branches:
- beta
jobs:
beta:
if: github.ref == 'refs/heads/beta'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a .remote-config.js file
run: |
touch .remote-config.js && echo "echo \"export default { apiUrl: 'https://localhost:3000', conferenceLayerUrl: 'https://localhost:8080' }\" > .remote-config.js" | bash -
- run: git config --global user.name SuperViz
- run: git config --global user.email ci@superviz.com
- name: Publish npm package
run: npm whoami && npm run semantic-release
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
slack:
needs: beta
name: Slack Notification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://avatars.slack-edge.com/2020-11-18/1496892993975_af721d1c045bea2d5a46_48.png
MSG_MINIMAL: true
SLACK_USERNAME: Deploy SDK beta version
43 changes: 43 additions & 0 deletions .github/workflows/publish-lab-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Lab Version
on:
push:
branches:
- lab
jobs:
lab:
if: github.ref == 'refs/heads/lab'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a .remote-config.js file
run: |
touch .remote-config.js && echo "echo \"export default { apiUrl: 'https://localhost:3000', conferenceLayerUrl: 'https://localhost:8080' }\" > .remote-config.js" | bash -
- run: git config --global user.name SuperViz
- run: git config --global user.email ci@superviz.com
- name: Publish npm package
run: npm whoami && npm run semantic-release
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
slack:
needs: lab
name: Slack Notification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://avatars.slack-edge.com/2020-11-18/1496892993975_af721d1c045bea2d5a46_48.png
MSG_MINIMAL: true
SLACK_USERNAME: Deploy SDK lab version
55 changes: 55 additions & 0 deletions .github/workflows/publish-prod-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish Latest Version
on:
push:
branches:
- main
jobs:
main:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install dependencies
run: yarn install
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a .remote-config.js file
run: |
touch .remote-config.js && echo "echo \"export default { apiUrl: 'https://localhost:3000', conferenceLayerUrl: 'https://localhost:8080' }\" > .remote-config.js" | bash -
- run: git config --global user.name SuperViz
- run: git config --global user.email ci@superviz.com
- name: Publish npm package
run: npm whoami && npm run semantic-release
env:
NPM_CONFIG_USERCONFIG: .npmrc.ci
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
slack:
needs: main
name: Slack Notification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://avatars.slack-edge.com/2020-11-18/1496892993975_af721d1c045bea2d5a46_48.png
MSG_MINIMAL: true
SLACK_USERNAME: Deploy SDK latest version
samples:
needs: main
name: Update samples version
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.SUPERVIZ_DEV_USER_TOKEN }}
repository: superviz/samples
event-type: new-release
client-payload: '{"version": "v0.0.0"}'
6 changes: 5 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"branches": ["main"],
"branches": [
"main",
{ "name": "beta", "channel": "beta", "prerelease": true },
{ "name": "lab", "channel": "lab", "prerelease": true }
],
"plugins": [
"@semantic-release/commit-analyzer",
"semantic-release-version-file",
Expand Down
1 change: 1 addition & 0 deletions __mocks__/realtime.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const ABLY_REALTIME_MOCK: AblyRealtimeService = {
privateModeWIOObserver: MOCK_OBSERVER_HELPER,
followWIOObserver: MOCK_OBSERVER_HELPER,
gatherWIOObserver: MOCK_OBSERVER_HELPER,
sameAccountObserver: MOCK_OBSERVER_HELPER,
subscribeToParticipantUpdate: jest.fn(),
unsubscribeFromParticipantUpdate: jest.fn(),
updateMyProperties: jest.fn(),
Expand Down
2 changes: 0 additions & 2 deletions sonar-project.properties

This file was deleted.

2 changes: 2 additions & 0 deletions src/common/types/cdn.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
CanvasPin,
HTMLPin,
Comments,
MousePointers,
Realtime,
Expand Down Expand Up @@ -46,6 +47,7 @@ export interface SuperVizCdn {
Realtime: typeof Realtime;
Comments: typeof Comments;
CanvasPin: typeof CanvasPin;
HTMLPin: typeof HTMLPin;
WhoIsOnline: typeof WhoIsOnline;
RealtimeComponentState: typeof RealtimeComponentState;
RealtimeComponentEvent: typeof RealtimeComponentEvent;
Expand Down
1 change: 1 addition & 0 deletions src/common/types/events.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export enum ParticipantEvent {
LOCAL_LEFT = 'participant.local-left',
LOCAL_UPDATED = 'participant.updated',
LIST_UPDATED = 'participant.list-updated',
SAME_ACCOUNT_ERROR = 'participant.same-account-error',
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/components/base/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ describe('BaseComponent', () => {
let DummyComponentInstance: DummyComponent;

beforeEach(() => {
console.error = jest.fn();

jest.clearAllMocks();
DummyComponentInstance = new DummyComponent();
});
Expand Down
Loading
Loading